我编了一个BP网络程序确定神经元隐含层的个数,却发现运行的时候老是错误,请高手帮忙指点,在此先谢过了!
程序如下:
clear
P=[0.0043 0.7327 0.0594 0.4952 0.1795 0.1506 0.1368 0.2865 0.1862 0.0987 ;
0.0042 0.6998 0.0594 0.4937 0.1807 0.1341 0.1821 0.2880 0.1862 0.0713;
0.0040 0.6709 0.0594 0.4973 0.1813 0.1547 0.1508 0.2981 0.1862 0.0678]'
T=[0.0042 0.6998 0.0594 0.4937 0.1807 0.1341 0.1821 0.2880 0.1862;
0.0040 0.6709 0.0594 0.4973 0.1813 0.1547 0.1508 0.2981 0.1862;
0.0039 0.7519 0.0594 0.4957 0.1795 0.1478 0.1850 0.2882 0.1862]'
s=5:14;
res=1:10;
for i=1:10
net=newff(minmax(P),[s(i),9],{'tansig', 'logsig'},'trainlm');
net.trainParam.epochs=2000;
net.trainParam.goa1=0.001;
net=train(net,P,T);
y=sim(net,P);
error=y-T;
res(i)= norm(error);
end
以下是运行后的错误显示
** Warning in INIT
** Network "input{1}.range" has a row with equal min and max values.
** Constant inputs do not provide useful information.