How do I get the mse after trainin a NN?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everyone,
I want to receive the mse from the trained neural network. To make it simple i form a 3 loops, where the out-of-sample time period is t=12, j=2 is the number of predictor and i=2 are the hidden units. Hence, at the end I should receive 2 mse, one for each predictor. I run the following code but the result doesn't look right. Any help please?
>> net = fitnet(hiddenLayerSize);
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 30/100;
net.divideParam.testRatio = 0/100;
net.trainParam.showWindow=false;
% net.trainFcn = 'trainbr';
% net.trainFcn = 'trainscg';
for t=1:12;
for j=1:2;
for i=1:2
[net,tr] = train(net,inputs(j,1:60+t-1),targets(:,2:60+t));
outputs = net(inputs(j,60+t));
errors = gsubtract(targets,outputs);
performance = perform(net,targets,outputs);
MSEtrn(j) = tr.perf(end)
MSEval = tr.vperf(end)
MSEtst = tr.tperf(end)
end;
end
end
Thanks in advance!
0 commentaires
Réponses (1)
Greg Heath
le 13 Déc 2016
There is no reason to consider individual vector components.
Rewrite your code in vector form like most of the code that is posted in both NEWSGROUP and ANSWERS. For example, search on
greg fitnet train
Hope this helps.
Greg
0 commentaires
Voir également
Catégories
En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!