[求助NN]Targets are incorrectly sized for network
% 输入向量p=[0.006435 0.769 0.089405 0.010515 0.05407 0.024686 0.017605 0.014827 0.013459 0.090442 0.43195 0.057381 0.034808 0.13204 0.17832 0.047342 0.017289 0.010431;
0.030757 0.70655 0.17671 0.0083132 0.020728 0.0043059 0.025851 0.026787 0 0.2885 0.67413 0.028507 0.0034102 0.0026688 0.00071647 0.0001677 0.0007909 0.0011105;
0.0082456 0.72203 0.16261 0.036162 0.025374 0.0093467 0.0088039 0.01152 0.015908 0.26995 0.69053 0.027846 0.0044571 0.0016853 0.00026745 0.0024056 0.0028537 0;
0.015773 0.77211 0.12353 0.0036335 0.0040505 0.020558 0.045907 0.014437 0 0.025636 0.91309 0.018366 0.01949 0.012919 0.0084749 0.0010797 0.00051013 0.00042954;
0.11061 0.83809 0.03798 0.0054783 0.0039668 0.001344 0.001132 0.0014024 0 0.26293 0.65417 0.064122 0.013247 0.0021703 0.0016238 0.00060129 0.0011333 0;
0.29364 0.53155 0.056557 0.052366 0.064815 0.00097964 4.91e-005 4.61e-005 0 0.16155 0.77406 0.033842 0.012823 0.014439 6.35e-005 0.00050308 0.00074605 0.0019726;
0.011783 0.86872 0.080401 0.010136 0.015795 0.012986 0.00018051 1.35e-006 7.08e-007 0.069005 0.85547 0.058077 0.011502 0.0045042 0.0014362 7.92e-006 2.28e-007 9.67e-007;
0.025886 0.88777 0.060151 0.010134 0.0085725 0.0044336 0.0016588 0.0013949 0 0.085714 0.82447 0.036405 0.010341 0.028887 0.011373 0.00076293 0.001019 0.0010319;
0.015157 0.86166 0.099782 0.016299 0.0011747 0.0005773 0.0037453 0.0015448 5.59e-005 0.28562 0.64232 0.052373 0.0070671 0.0087178 0.0010695 0.00075847 0.00031316 0.001762;
0.0067199 0.4611 0.061973 0.01539 0.016279 0.1461 0.26432 0.028122 0 0.11139 0.8296 0.040266 0.0076027 0.0083068 0.0028086 1.52e-005 6.09e-006 1e-005;
0.033283 0.66561 0.2167 0.029361 0.021834 0.0064433 0.0082356 0.0086857 0.0098478 0.081075 0.7356 0.1648 0.010524 0.0038537 0.00096214 8.64e-005 0.0011867 0.0019129;
0.16729 0.65497 0.035793 0.028243 0.0019858 0.010273 0.03095 0.057832 0.012658 0.095007 0.77541 0.052735 0.0067518 0.019334 0.0020419 0.0058582 0.024642 0.018225;
0.29144 0.68326 0.01905 0.0033874 0.0026674 4.24e-005 7.93e-005 7.11e-005 0 0.054889 0.88382 0.030772 0.0071211 0.014433 0.0017659 0.0028884 0.0043121 0;
0.10995 0.82134 0.04278 0.0098101 0.0023359 0.0014514 0.0033198 0.0057371 0.0032771 0.22469 0.72682 0.037257 0.005091 0.0025708 0.0032496 0.00014396 3.18e-005 0.00015159;
0.12098 0.86188 0.0074501 0.007479 0.0020854 1.06e-005 2.45e-005 2.46e-005 6.78e-005 0.32483 0.61562 0.046175 0.0072492 0.0040954 0.0014257 0.00024484 0.0003589 0;
0.056305 0.86306 0.036891 0.0246 0.0033599 0.015308 0.00022867 7.15e-005 3.55e-005 0.14807 0.80612 0.033464 0.006666 0.0012728 0.0034423 0.0003615 0.00038632 0.00022069;
0.05089 0.65237 0.01536 0.016385 0.027625 0.0070587 0.12882 0.10149 0 0.12277 0.7823 0.060639 0.017134 0.0084732 0.0080046 3.03e-005 0.00023039 0.00041354;
0.0010265 0.074046 0.020432 0.022179 0.24617 0.44806 0.18714 0.00095132 0 0.042023 0.87949 0.050561 0.0089621 0.010834 0.00012349 0.001822 0.0031795 0.00301;
0.037199 0.89272 0.042293 0.018672 0.003859 0.0048854 6.06e-005 0.00013708 0.00017359 0.0061809 0.7509 0.21656 0.020868 0.0017918 0.0022563 0.00057024 0.00058981 0.00027665;
0.041159 0.93903 0.01553 0.0039504 0.00012857 2.18e-005 6.35e-006 5.75e-005 0.00011235 0.053421 0.87641 0.053934 0.0065829 0.00044831 0.0022862 0.0017646 0.0028725 0.0022838;
0.036704 0.88556 0.031196 0.027146 0.011242 0.0039909 0.0010187 0.001293 0.001853 0.094957 0.8251 0.065881 0.0077238 0.0016406 0.0021107 0.0010079 0.00034494 0.0012381];
% 输出向量
t=[-0.1 -0.09 -0.08 -0.07 -0.06 -0.05 -0.04 -0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1];
% 归一化
for i=1:21
p(i,:)=(p(i,:)-min(p(i,:)))/(max(p(i,:))-min(p(i,:)));
end
t=(t-min(t))/(max(t)-min(t));
% BP神经网络建立
net=newff(minmax(p),,{'tansig','logsig'},'trainlm');
net.trainparam.epochs=1000;
net.trainparam.goal=0.0001;
LP.lr=0.1;
net=train(net,p,t);
运行结果为:
??? Error using ==> network.train at 146
Targets are incorrectly sized for network.
Matrix must have 18 columns.
Error in ==> mybpuse at 35
:'( :'(
matlab高手帮忙解决下,再三感激!
net=train(net,p,t); 看看train的help,要求p和t的列数应该一致。
P
Ni x TS cell array
Each element P{i,j,ts} is an Ni x Q matrix.
T
Nl x TS cell array
Each element T{i,ts} is a Ui x Q matrix.
回复 沙发 friendchj 的帖子
谢谢大虾!
页:
[1]