veronicahan 发表于 2007-3-28 13:47

求助:newff语句的使用问题

用newff建立BP网络的时候,如果用trainlm方法,即
net=newff(,,{'tansig','logsig','purelin'},'trainlm');
是可以定义的,
可是如果把trainlm改为traingd,即
net=newff(,,{'tansig','logsig','purelin'},'traingd');
则会产生错误,如下所示
Warning: feval on script names will not work, or may work differently,
in a future version of MATLAB. To make your code insensitive to any change
and to suppress this warning message:
- Either change the script to a function.
- Or use eval instead of feval.
The script file in question is traingd.
> In network.subsasgn>setTrainFcn at 1459
In network.subsasgn at 405
In newff at 160
??? Attempt to execute SCRIPT traingd as a function.

Error in ==> network.subsasgn>setTrainFcn at 1459
net.trainParam = feval(trainFcn,'pdefaults');

Error in ==> network.subsasgn at 405
=setTrainFcn(net,trainFcn);

Error in ==> newff at 160
net.trainfcn = btf;
请问这是什么原因?

eight 发表于 2007-3-28 15:11

原帖由 veronicahan 于 2007-3-28 13:47 发表
用newff建立BP网络的时候,如果用trainlm方法,即
net=newff(,,{'tansig','logsig','purelin'},'trainlm');
是可以定义的,
可是如果把trainlm改为traingd,即
net=newff(,,{'tansig','logsig','purelin'},' ...


我运行了一下,没有问题,请保证所用的 newff 函数是matlab默认的,有疑问请看帖子:“写给学习matlab的新手们”

bank103kimo 发表于 2008-11-6 16:36

我也运行了一下,没有问题

科技在线 发表于 2008-11-6 17:07

是不是你把函数给代用啦
页: [1]
查看完整版本: 求助:newff语句的使用问题