MATLAB: Neural Network simulation for the output value is different from the output value obtained by using calculations, why

neural networkneural networks

Input data – 3 x 150 (3 inputs , 150 data), Target – 1 x 150 ( 1×50 each for 0, 0.5 and 1.0 respectively), Sample = [20 50 60]; newff(…); % create custom network, [net,tr] = train(net,Inputs,Targets); % train the network, Output = net(Sample') %Predict the output value for the sample (input data). The training stopped at about 10 iterations.
But the output value obtained from Output = net(Sample') is totally different from the output value obtained by using the following calculations,
For example – Calculate (back-propagate) hidden layer and output layer errors, δA = outA (1 – outA) (δαWA + δβWA) Change hidden layer weights, WA_new = WA_old + ηδA inλ Change output layer weights, WB_old = WB_old + ηδα outA and so on.
By using Output = net(Sample') , it was 0.975 . However, from calculations, the value was 0.777 for 1 iteration . The target for this sample is 1.0.
Does anyone know about this? Thanks.

Best Answer

Insufficent information
1. What do the 3 target values represent?
2. Your analytic calculations make no sense
a. Samples should be 3-D columns
b. yn = B2 + LW*tanh(B1 + IW*xn)
for normalized inputs and targets. See
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341631#936181
Hope this helps.
Thank you for formally accepting my answer
Greg