Neural Network in loops: How can I set up a loop to train at least 10 neural networks with the same parameters and save only the best performance, regression and histogram error, and the matrix-only MATLAB function for neural network code?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Anderson
am 23 Okt. 2015
Beantwortet: Greg Heath
am 29 Okt. 2015
Hi,
How can I set up a loop to train at least 10 neural networks with the same parameters and save only the best performance, regression and histogram error, and the matrix-only MATLAB function for neural network code?
More specifically, for example, what do I need to change in the following code provided by MATLAB:
inputs = houseInputs; targets = houseTargets;
% Create a Fitting Network hiddenLayerSize = 10; net = fitnet(hiddenLayerSize);
% Set up Division of Data for Training, Validation, Testing net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100;
% Train the Network [net,tr] = train(net,inputs,targets);
% Test the Network outputs = net(inputs); errors = gsubtract(outputs,targets); performance = perform(net,targets,outputs)
% View the Network view(net)
% Plots % Uncomment these lines to enable various plots. % figure, plotperform(tr) % figure, plottrainstate(tr) % figure, plotfit(targets,outputs) % figure, plotregression(targets,outputs) % figure, ploterrhist(errors)
Thank you!
0 Kommentare
Akzeptierte Antwort
Greg Heath
am 29 Okt. 2015
Search the NEWSGROUP and ANSWERS using
Hmin:dH:Hmax Ntrials
for my double-loop design examples that are typically over numel(Hmin:dH:Hmax) = 10
values of hidden nodes and Ntrials = 10 different random initial weight designs for each
value of H.
Hope this helps.
Thank you for formally accepting my answer
Greg
PS most of the designs just print out the 10x10 matrix of performance values. However, there are a couple which do keep a running track of the best current design.
0 Kommentare
Weitere Antworten (1)
Nick Hobbs
am 27 Okt. 2015
I understand you want to train 10 networks and determine the best network from the set of networks. The following documentation link on analyzing neural networks after training may help you with your goal.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!