linden
2009-03-05, 19:14
>> P=-1:0.1:1;
T=[-0.9602 -0.5770 -0.0729 0.3771 0.6405 0.6600 0.4609 0.1336 -0.2013 -0.4344 -0.5000 -0.3930 -0.1647 0.0988 0.3072 0.3960 0.3449 0.1816 -0.0312 -0.2189 -0.3201];
plot(P,T,'*')
net=newff(minmax(P),[8,1],{'tansig','logsig'},'trainlm');
net.trainParam.epochs=2000;
net.trainParam.goal=0.001;
net=train(net,P,T);
y=sim(net,P);
error=y-T;
res=norm(error);
程序如上,每次运行时结果都不一样,为什么?
还有就是这段程序是从书上抄的,书上说可以达到训练要求,可我试了多次也不行为什么?
T=[-0.9602 -0.5770 -0.0729 0.3771 0.6405 0.6600 0.4609 0.1336 -0.2013 -0.4344 -0.5000 -0.3930 -0.1647 0.0988 0.3072 0.3960 0.3449 0.1816 -0.0312 -0.2189 -0.3201];
plot(P,T,'*')
net=newff(minmax(P),[8,1],{'tansig','logsig'},'trainlm');
net.trainParam.epochs=2000;
net.trainParam.goal=0.001;
net=train(net,P,T);
y=sim(net,P);
error=y-T;
res=norm(error);
程序如上,每次运行时结果都不一样,为什么?
还有就是这段程序是从书上抄的,书上说可以达到训练要求,可我试了多次也不行为什么?