How can I use Neural Networks to create several networks instead of creating one by one manually?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sarah
am 27 Apr. 2014
Kommentiert: Greg Heath
am 29 Apr. 2014
Hey,
I would like to create several neural networks models and estimations using for each one of them 2 variables as inputs and 1 variable as output. For a single stock I would use the NNtool to first construct the model and then do the estimation. What I would like to know is how could I do this for all the stocks (30 stocks and for each one of them I would like to create a nn estimation) in an automatic way without having to run the wizard for each one of them.
Thanks you for your support,
Best regards,
Sarah
0 Kommentare
Akzeptierte Antwort
Greg Heath
am 28 Apr. 2014
You can do it with nested for loops. Indexed nets should be stored in cells. However, it is not clear what the difference in inputs is for the 30 stocks. Also, what are the outputs? I assume this is regression and not classification. Therefore you should use the FITNET version of feedforwardnet (NEWFIT version of newff if you are using the obsolete version).
A single hidden layer is sufficient. Accept all defaults except the number of hidden nodes, H=10; Try to use the smallest value of H that yields acceptable results.
Also, you have to take into account that some designs will be bad because of an unfortunate assignment of random initial weights. Therefore, for each case, multiple random initial weight designs will have to be made to obtain an acceptable one.
I typically look at Ntrials = 10 random initialization designs for each of ~10 candidate values for H. Search using
greg fitnet Ntrials
Hope this helps.
Thank you for formally accepting my answer
Greg
2 Kommentare
Weitere Antworten (1)
Apdullah YAYIK
am 27 Apr. 2014
Of course you can create several neural networks and control their variables (transfer functions, hidden layers, neuron numbers of training algorithms)for your estimation or classification problems. For example ---First ANN--- nn=10;mm=10;pp=10; %%Neuron Numbers net1=newfit(minmax(target{1,1}),[nn,mm,pp,1],{'radbas','purelin','radbas','purelin','radbas'},'trainbr'); net1.trainparam.min_grad=0; net1.trainparam.mu_max=1.e+10; net1.trainParam.epochs=20; net1=train(net1,target{1,1},acik_bin_reshaped{1,1}); ---Second ANN--- net2=newfit(minmax(target{1,2}),[nn,mm,pp,1],{'radbas','purelin','radbas','purelin','radbas'},'traingda'); net2.trainparam.min_grad=0; net2.trainparam.mu_max=1.e+10; net2.trainParam.epochs=20; net2=train(net2,target{1,2},acik_bin_reshaped{1,2}); ---Third ANN--- %%%%%%%%%%%%%%%%%%%%%3.Boyut NN%%%%%%%%%%%%%%%%%%%%% net3=newfit(minmax(target{1,3}),[nn,mm,pp,1],{'radbas','purelin','radbas','purelin','radbas'},'traingda'); net3.trainparam.min_grad=0; net3.trainparam.mu_max=1.e+10; net3.trainParam.epochs=20; net3=train(net3,target{1,3},acik_bin_reshaped{1,3});
Then, you can simulate each of them independently.
output1=sim(net1,target{1,1}); output2=sim(net2,target{1,2}); output3=sim(net3,target{1,3});
Siehe auch
Kategorien
Mehr zu Deep Learning Toolbox 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!