reza
unread,Feb 11, 2012, 2:03:09 AM2/11/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
hi everyone,
i have a NN code ,my result is over-fitting each time i tried,please teach me how to use mapstd or ..... please simple way. this is my code:
Close all;
clear all;
load Input
num=data;
Em=num(:,1);
Fm=num(:,2);
dn=num(:,3);
dm=num(:,4);
%%%%%%%%
p1=num(1:1400,(1:3)); p11=p1';
A =dm(1:1400,1); A1=A';
net_gas = newff([ 0 1;0 1;0 1],[10,20,1],{'tansig','tansig','purelin'},'trainlm');
net_gas.trainParam.show = 100;
net_gas.trainParam.epochs = 200;
%net_gas.performFcn = 'msereg';
%net_gas.performParam.ratio = 0.1;
net_gas.trainParam.goal = 1e-10;
%training session
net_gas=train(net_gas,p11,A1);
save net_gas
%Simulation session
y1 = sim(net_gas,p11);
y1f= y1;
H1=y1f';
%H2=H1*388.8;
%Neural Network Performance
Error= (H1-dm(1:1400))./dm(1:1400)*100;
figure
x= 1:1:1400;
plot (x, Error); grid
xlabel('Expr#');
ylabel('%Error');
title('NN performance for H');
axis([1 1400 -25 25]);
%Test session
pt1=num((1401:1822),(1:3));
pt11=pt1';
yt1 = sim(net_gas,pt11);
yt1f= yt1;
Ht1=yt1f';
%Ht2= Ht1*388.8;
Error_test= (Ht1-dm(1401:1822))./dm(1401:1822)*100;
figure
xt= 1:1:422;
plot (xt, Error_test); grid
xlabel('Exp#');
ylabel('%Error_test');
title('NN performance for H');
axis([1 422 -100 100]);