Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Neural network Help: Urgent

1 Ansicht (letzte 30 Tage)
Ahmed
Ahmed am 22 Jan. 2012
Dear Colleagues
Hope my email finds you well. I made a code using m-file in Matlab to obtain the optimum number of hidden neuron. So that I made a loop to try the performance (MSE) from the number of inputs to the twice number of inputs.
My problem is that the program calculate save the results of last iteration only in work space. So that I need advice about:
1. How to save the results after each iterations in the work space.
2. How to plot the performance graphs after each iteration separately.
3. How to plot the total number of hidden neurons (i) versus MSE in each iterations and let the program calculate the best number of hidden neuron.
[I N]=size(input);
for i=I:I*2
network=newff(input,target,i,{'logsig' 'purelin'},'trainlm');
view(network)
% NN training
network=init(network);
[network,tr]=train(network,input,target);
% Testing the Neural Network
y=sim(network,input);
residual=target-y;
figure
plot(residual)
title('Prediction Errors');
xlabel('Pattern Sequence');
ylabel('Residuals');
% NN weight and bias matrices
Layer1_Weights=network.iw{1};
Layer1_Bias=network.b{1};
Layer2_Weights=network.lw{2};
Layer2_Bias=network.b{2};
Layer1_Weights;
Layer1_Bias;
Layer2_Weights;
Layer2_Bias;
end

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by