-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrainEspecieNN.m
40 lines (32 loc) · 1.2 KB
/
TrainEspecieNN.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function [redeNeuronal data timers precision input target imagens] = TrainEspecieNN(data_file, path_to_files, scale)
addpath(genpath('./Functions'));
%override for test's
path_to_files = './Tema 1 - RN\Folhas_1';
scale = 175;
data_file = '.\Tema 1 - RN\ClassificaçãoFolhas.xlsx';
%Data Extration -----------------------------------------------------------
%- Images
tstart = tic;%timer
imagens = LoadImages(path_to_files, scale);
imagens = UpdateImages(imagens,data_file, scale);
%- Input and Output Generation
input = inputfromImageExtration(imagens, scale);
target = targetCodigoSubEspecie(imagens);
data_extration = toc(tstart); %timer
%Run Especie NN -----------------------------------------------------------
nstart = tic;
NNparam.topologia = 'cascadeforwardnet';
NNparam.fAtivacao = 'tansig';
NNparam.fTreino = 'trainrp';
NNparam.neuronios = 10;
NNparam.trainRatio = 0.7;
NNparam.valRatio = 0.15;
NNparam.testRatio = 0.15;
NNparam.max_fail = 25;
[redeNeuronal data pTotal pTeste] = NeuralNetwork(NNparam, input, target);
cnn_extration = toc(nstart);
%view(redeNeuronal);
timers = {data_extration;cnn_extration};
precision = {pTotal; pTeste};
% % %---------------------------------------------------
end