Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: neural network
Replies: 1   Last Post: Apr 22, 2014 5:11 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Murugan Solaiyappan

Posts: 35
Registered: 12/4/10
neural network
Posted: Apr 17, 2014 6:34 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear matlab friends,

While I am training the net, the mse value is differ.
I want to know the working principles of mse function in matlab tool.
I am writing the code with mse function and without using mse function (i.e. fromula)

But, the output is differ.
Kindly share your answer.

Here is my code

clc;
clear;
close all;
p = [0 1 2 3 4 5 6 7 8 9];
t = [0 0.84 0.91 0.14 -0.77 -0.96 -0.28 0.66 0.99 0.77];

net = newff(p,t,10);
net.trainParam.epochs = 50;
net.trainParam.goal = 0.01;
[net tr Y E] = train(net,p,t);
y1 = sim(net,p);

%calculating MSE system call
fprintf('Mean Squared Error [MSE] %d\n',mse(E));

%Calculating MSE by using formula');

sum_mse=0;

for i=1:6
e(i)=t(i)-y1(i);
temp=(e(i)*e(i));
sum_mse=sum_mse+temp ;
end
fprintf('Mean Squared Error [MSE] formula %d\n',sum_mse/6);




the output is,



Mean Squared Error [MSE] 1.310413e-003
Mean Squared Error [MSE]formula 2.975099e-002



Manual output



p t output Error ErrorSq.
0 0 -0.2761 0.2761 0.07623121
1 0.84 0.8399 1E-04 1E-08
2 0.91 0.9103 -0.0003 9E-08
3 0.14 0.4473 -0.3073 0.09443329
4 -0.77 -0.6961 -0.0739 0.00546121
5 -0.96 -1.0083 0.0483 0.00233289
6 -0.28
7 0.66
8 0.99
9 0.77
mse= 2.97E-02


Date Subject Author
4/17/14
Read neural network
Murugan Solaiyappan
4/22/14
Read Re: neural network
Greg Heath

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.