马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
我编了一个如下的bp网络程序,
p=[3 0.3 1.6 0.4 0.1 0.05;
3 0.3 0.1 0.5 0.2 0.1;
3 0.3 0.8 0.7 0.4 0.3;
3 0.6 0.1 0.4 0.2 0.3;
3 0.6 0.8 0.5 0.4 0.05;
3 0.6 1.6 0.7 0.1 0.1;
3 1.2 0.8 0.4 0.4 0.1;
3 1.3 1.6 0.5 0.1 0.3;
3 1.2 0.1 0.7 0.2 0.05;
4 0.3 0.8 0.4 0.1 0.05;
4 0.3 1.6 0.5 0.2 0.1;
4 0.3 0.1 0.7 0.4 0.3;
4 0.6 1.6 0.4 0.2 0.3;
4 0.6 0.1 0.5 0.4 0.05;
4 0.6 0.8 0.7 0.1 0.1;
4 1.2 0.8 0.4 0.4 0.1;
4 1.2 1.6 0.5 0.1 0.3;
4 1.2 0.1 0.7 0.2 0.05;
5 0.3 1.6 0.4 0.1 0.05;
5 0.3 0.1 0.5 0.2 0.1;
5 0.3 0.8 0.7 0.4 0.3;
5 0.6 0.1 0.4 0.2 0.3;
5 0.6 0.8 0.5 0.4 0.05;
5 0.6 1.6 0.7 0.1 0.1;
5 1.2 0.8 0.4 0.4 0.1;
5 1.2 1.6 0.5 0.1 0.3];
p=p'
t=[32.13 50.3;
32.27 13.7;
29.93 63.0;
30.20 6.40;
33.00 55.5;
30.90 69.0;
29.60 53.6;
29.50 61.5;
29.40 10.9;
33.60 50.4;
34.10 68.7;
33.22 18.7;
33.20 72.2;
32.48 28.6;
33.55 60.1;
28.95 55.8;
29.72 65.6;
23.95 5.60;
25.66 71.3;
21.36 26.3;
24.30 61.2;
24.84 4.40;
21.50 57.5;
25.88 63.6;
23.14 54.0;
24.30 68.3];
t=t';
[np,minp,maxp,nt,mint,maxt]=premnmx(p,t);
net=newff([-1,1],[22,2],{'tansig','logsig','purelin'},'traingd');
net=init(net);
net.trainParam.show = 50;
net.trainParam.lr = 0.05;
net.trainParam.epochs = 10000;
net.trainParam.goal = 0.1;
net=train(net,np,nt);
na= sim(net,np);
b=postmnmx(na,minp,maxp)
然后在matlab上运行,提示出这样的错误“Error using ==> network.train
Inputs are incorrectly sized for network.
Matrix must have 1 rows.”
请问这是什么地方出错了啊?我看了很久也没看出来,提示说输入不对,至少要有一行,可我的输入不可能没有一行啊? |