求助求助!MATLAB BP仿真
P=[10100000001111111111111111010111000000101010101010101;1010000000111111111111111101...
P=[1 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1;1 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1];
T=[1 0 0 1;1 0 1 1];
P=P';
T=T';
NodeNum=10;
TypeNum=2;
Epochs=1000;
TF1='tansig';TF2='logsig';
net=newff(P,T,[NodeNum TypeNum],{TF1 TF2},'trainlm');
net.trainParam.epochs=Epochs;
net.trainParam.goal=1e-8;
net.trainParam.min_grad=1e-20;
net.trainParam.show=200;
net.trainParam.time=inf;
net=train(net,P,T);
P2=[1 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1;1 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1];
P_test=P2';
X=sim(net,P_test);
为什么仿真不出来啊??求高手解答! 展开
T=[1 0 0 1;1 0 1 1];
P=P';
T=T';
NodeNum=10;
TypeNum=2;
Epochs=1000;
TF1='tansig';TF2='logsig';
net=newff(P,T,[NodeNum TypeNum],{TF1 TF2},'trainlm');
net.trainParam.epochs=Epochs;
net.trainParam.goal=1e-8;
net.trainParam.min_grad=1e-20;
net.trainParam.show=200;
net.trainParam.time=inf;
net=train(net,P,T);
P2=[1 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1;1 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1];
P_test=P2';
X=sim(net,P_test);
为什么仿真不出来啊??求高手解答! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询