-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclassifier.m
More file actions
31 lines (23 loc) · 741 Bytes
/
classifier.m
File metadata and controls
31 lines (23 loc) · 741 Bytes
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
function trainedNet = classifier(PTreino,TTreino)
trainFunc = 'trainlm';
transferFunc = 'logsig';
net = feedforwardnet([5,5],trainFunc);
% Configuração das Camadas Escondidas
net.numLayers = 3;
net.layers{1}.transferFcn = transferFunc;
net.layers{2}.transferFcn = transferFunc;
%Parametros de Treino
net.trainParam.epochs = 2000;
net.trainParam.min_grad = 10e-20;
net.trainParam.lr = 10e-30;
net.performFcn = 'msereg';
net.trainParam.mu_inc = 2;
net.trainParam.mu_dec = 1;
net.trainParam.max_fail = 500;
net.trainParam.goal = 1e-99;
net.trainParam.mu_max = 10e60;
%Divisão do Set Balanceado para treino e validação
net.divideParam.trainRatio = 80/100;
net.divideParam.valRatio = 20/100;
trainedNet = train(net,PTreino',TTreino');
end