Info

此问题已关闭。 请重新打开它进行编辑或回答。

Neural network Help: Urgent

1 次查看(过去 30 天)
Ahmed
Ahmed 2012-1-22
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

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by