![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
matlab的神经网络工具箱问题
matlab2012a,使用神经网络工具箱出问题,即便是help的例子也出现这种问题,如下:net=feedforward(2);结果有如下的提示:Errorusings...
matlab 2012a,使用神经网络工具箱出问题,即便是help的例子也出现这种问题,如下:
net=feedforward(2);
结果有如下的提示:
Error using struct
Conversion to struct from double is not possible.
Error in network/subsasgn>getDefaultParam (line 2040)
param = struct(feval(fcn,'defaultParam'));
Error in network/subsasgn>setPerformFcn (line 1903)
net.performParam = getDefaultParam(performFcn);
Error in network/subsasgn>network_subsasgn (line 448)
if isempty(err), [net,err]=setPerformFcn(net,performFcn); end
Error in network/subsasgn (line 13)
net = network_subsasgn(net,subscripts,v,netname);
Error in feedforwardnet>create_network (line 134)
net.performFcn = 'mse';
Error in feedforwardnet (line 69)
net = create_network(param);
这到底是什么问题呢,哪位高手解答一下! 展开
net=feedforward(2);
结果有如下的提示:
Error using struct
Conversion to struct from double is not possible.
Error in network/subsasgn>getDefaultParam (line 2040)
param = struct(feval(fcn,'defaultParam'));
Error in network/subsasgn>setPerformFcn (line 1903)
net.performParam = getDefaultParam(performFcn);
Error in network/subsasgn>network_subsasgn (line 448)
if isempty(err), [net,err]=setPerformFcn(net,performFcn); end
Error in network/subsasgn (line 13)
net = network_subsasgn(net,subscripts,v,netname);
Error in feedforwardnet>create_network (line 134)
net.performFcn = 'mse';
Error in feedforwardnet (line 69)
net = create_network(param);
这到底是什么问题呢,哪位高手解答一下! 展开
3个回答
展开全部
线性神经网络的构建:
net=newlin(PR,S,ID,LR)
PR--Rx2阶矩阵,R个输入元素的最小最大矩阵
S---输出层神经元个数
ID--输入延迟向量,默认值为[0]
IR--学习率,默认值为0.01
net = newlin([-1 1;-1 1],1); 表示设计的是一个双输入单输出线性神经网络
P = [1 2 2 3; 2 1 3 1];表示输入样本有四个,每一列就是一个输入样本
又比如假设我们期望的输出为 T=[1 2 3 4],则一个简单的神经网络如下:
>>net = newlin([-1 1;-1 1],1);%创建初始网络
P=[1 2 2 3; 2 1 3 1]%输入
T=[1 2 3 4]%期望的输出
net=newlind(P,T);%用输入和期望训练网络
Y=sim(net,P)%仿真,可以看到仿真结果Y和期望输出T的接近程度
P =
1 2 2 3
2 1 3 1
T =
1 2 3 4
Y =
0.8889 2.1667 3.0556 3.8889
楼主可以从《matlab神经网络与应用(第二版)》董长虹 开始入门神经网络的matlab实现
参考资料:《matlab神经网络与应用(第二版)》
net=newlin(PR,S,ID,LR)
PR--Rx2阶矩阵,R个输入元素的最小最大矩阵
S---输出层神经元个数
ID--输入延迟向量,默认值为[0]
IR--学习率,默认值为0.01
net = newlin([-1 1;-1 1],1); 表示设计的是一个双输入单输出线性神经网络
P = [1 2 2 3; 2 1 3 1];表示输入样本有四个,每一列就是一个输入样本
又比如假设我们期望的输出为 T=[1 2 3 4],则一个简单的神经网络如下:
>>net = newlin([-1 1;-1 1],1);%创建初始网络
P=[1 2 2 3; 2 1 3 1]%输入
T=[1 2 3 4]%期望的输出
net=newlind(P,T);%用输入和期望训练网络
Y=sim(net,P)%仿真,可以看到仿真结果Y和期望输出T的接近程度
P =
1 2 2 3
2 1 3 1
T =
1 2 3 4
Y =
0.8889 2.1667 3.0556 3.8889
楼主可以从《matlab神经网络与应用(第二版)》董长虹 开始入门神经网络的matlab实现
参考资料:《matlab神经网络与应用(第二版)》
展开全部
My guess is that you created your own function mse.m that is shadowing the
mse.m included in Neural Network Toolbox and that function does not accept
and handle all the inputs that the Neural Network Toolbox's version does.
mse.m included in Neural Network Toolbox and that function does not accept
and handle all the inputs that the Neural Network Toolbox's version does.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询