MATLAB BP神经网络多输入单输出代码问题 5
问题内容是根据列车的入口速度,出口速度和间隔时间这三个输入量来估计区间距离,T是调整后的期望距离,运行程序出现以下错误Warning:NEWFFusedinanobsol...
问题内容是根据列车的入口速度,出口速度和间隔时间这三个输入量来估计区间距离,T是调整后的期望距离,运行程序出现以下错误
Warning: NEWFF used in an obsolete way.
> In obs_use at 18
In newff>create_network at 127
In newff at 102
In bplizi at 1031
See help for NEWFF to update calls to the new argument list.
Error using traingd (line 102)
Inputs and targets have different numbers of samples.
Error in network/train (line 106)
[net,tr] = feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);
Error in bplizi (line 1044)
[net_1,tr]=train(net_1,P,T);
求大神指导!!
以下是原代码:
clear all;
x1=[256*1矩阵];
x2=[256*1矩阵];
x3=256*1矩阵];
P=[x1,x2,x3];
T=[256*1矩阵];
net_1=newff([0,1;0,1;0,1],[6,1],{'tansig','purelin'},'traingdm');
inputWeights=net_1.IW{1,1};
inputbias=net_1.b{1};
% 当前网络层权值和阈值
layerWeights=net_1.LW{2,1};
layerbias=net_1.b{2};
% 设置训练参数
net_1.trainParam.epochs = 10000;
net_1.trainParam.goal = 1e-3;
net_1.trainParam.show=50;
net_1.trainParam.lr=0.05;
net_1.trainParam.mc=0.9;
% 调用 TRAINGDM 算法训练 BP 网络
[net_1,tr]=train(net_1,P,T);
% 对 BP 网络进行仿真
A = sim(net_1,P);
plot(P,T)
% 计算仿真误差
V=net_1.iw{1,1};%输入层到中间层权值
theta1=net_1.b{1};%中间层各神经元阈值
W=net_1.lw{2,1};%中间层到输出层权值
theta2=net_1.b{2};%输出层各神经元阈值
E = T - A;
MSE=mse(E);
figure(1)
plot(E,'- *')
title('BP网络训练误差','fontsize',10)
ylabel('误差','fontsize',10)
xlabel('样本','fontsize',10) 展开
Warning: NEWFF used in an obsolete way.
> In obs_use at 18
In newff>create_network at 127
In newff at 102
In bplizi at 1031
See help for NEWFF to update calls to the new argument list.
Error using traingd (line 102)
Inputs and targets have different numbers of samples.
Error in network/train (line 106)
[net,tr] = feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);
Error in bplizi (line 1044)
[net_1,tr]=train(net_1,P,T);
求大神指导!!
以下是原代码:
clear all;
x1=[256*1矩阵];
x2=[256*1矩阵];
x3=256*1矩阵];
P=[x1,x2,x3];
T=[256*1矩阵];
net_1=newff([0,1;0,1;0,1],[6,1],{'tansig','purelin'},'traingdm');
inputWeights=net_1.IW{1,1};
inputbias=net_1.b{1};
% 当前网络层权值和阈值
layerWeights=net_1.LW{2,1};
layerbias=net_1.b{2};
% 设置训练参数
net_1.trainParam.epochs = 10000;
net_1.trainParam.goal = 1e-3;
net_1.trainParam.show=50;
net_1.trainParam.lr=0.05;
net_1.trainParam.mc=0.9;
% 调用 TRAINGDM 算法训练 BP 网络
[net_1,tr]=train(net_1,P,T);
% 对 BP 网络进行仿真
A = sim(net_1,P);
plot(P,T)
% 计算仿真误差
V=net_1.iw{1,1};%输入层到中间层权值
theta1=net_1.b{1};%中间层各神经元阈值
W=net_1.lw{2,1};%中间层到输出层权值
theta2=net_1.b{2};%输出层各神经元阈值
E = T - A;
MSE=mse(E);
figure(1)
plot(E,'- *')
title('BP网络训练误差','fontsize',10)
ylabel('误差','fontsize',10)
xlabel('样本','fontsize',10) 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询