BP神经网络问题
以下是一段BP神经网络的代码,为什么运行时总是出现Index exceeds matrix dimensions的错误提示,麻烦哪位大侠帮忙下...P=[27000 297.35 327.53 2658 6.31 68.3 15948 737 16316 583.89 1.96;
30619 325.00 390.51 2763 6.94 69.6 17130 789 18600 707.67 2.28;
33282 423.00 474.63 2801 5.73 69.7 17866 894 19886 861.88 2.32;
33689 467.57 569.55 2887 7.76 69.8 18961 1015 20249 941.99 2.38;
41020 538.17 616.25 2920 8.23 69.7 19688 1198 21626 1082.6 2.73;
43344 832.04 686.37 3495 8.87 68.3 24465 1361 23544 1373.4 2.89;
46030 941.94 788.15 3495 9.57 68.2 24814 1710 24941 1756.5 2.82;
53887 1095.13 969.1 4885 9.65 68.7 36149 2100 25936 2199.5 3.08;
59271 1250.64 1092.6 5376 10.11 69.2 43008 2314 26596 2625.4 3.56;
64507 1437.67 1176.1 6091 15.05 69.2 51946 2500 28494 3229.4 3.98;
70597 1671.29 1273.7 7305 16.81 69.2 65745 2614 29628 3744.7 4.98;
79221 1905.03 1345 8023 18.6 69.1 70346 2798 30063 3792.6 5.1;
78812 2207.88 927.16 8328 20.52 69.3 71088 2964 30904 3951.64 5.21];
T=;
=premnmx(P);
=premnmx(T);
net=newff(minmax(pn(:,1:12)),,{'tansig','purelin'},'trainlm');
net=init(net);
net.trainParam.epochs=20000;
net.trainParam.goal=0.0001;
net.trainParam.lr=0.05;
net=train(net,pn(:,1:12),tn(1:12));
t_sim=sim(net,pn);
t_sim=postmnmx(t_sim,mint,maxt)
relative_error=abs(t_sim(1:13)-T)./T
figure(1)
i=1:1:length(t_sim);
j=1:length(T);
plot(i,t_sim,'r',j,T,'bo')
legend('test value','true value','relative_error')
title('result compare between test value and true value') 不懂!!!!!!!!!!1111 yun....... 不懂呀!!!!!! 好多数据呀!! 这个是因为数组维数出问题了,你再看看吧。 报错应该是说矩阵维数不对,net=newff(minmax(pn(:,1:12)),,{'tansig','purelin'},'trainlm');
12应该改为11,后面的也要改。我试了一下,没有迭代完,还有错误········ 改过了了,但是程序运行到后来怎么还是有该错误提示呢,麻烦高手赐教... 7# 诸葛孔明 把具体的问题发上来,更好理解! 具体的问题就是Index exceeds matrix dimensions.现在前后维度都改过了阿。。。 9# wen1055
页:
[1]
2