声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3737|回复: 3

[编程技巧] 求助:newff语句的使用问题

[复制链接]
发表于 2007-3-28 13:47 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
用newff建立BP网络的时候,如果用trainlm方法,即
net=newff([0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1],[9 6 2],{'tansig','logsig','purelin'},'trainlm');
是可以定义的,
可是如果把trainlm改为traingd,即
net=newff([0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1],[9 6 2],{'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
  [net,err]=setTrainFcn(net,trainFcn);

Error in ==> newff at 160
net.trainfcn = btf;
请问这是什么原因?
回复
分享到:

使用道具 举报

发表于 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的新手们”
发表于 2008-11-6 16:36 | 显示全部楼层
我也运行了一下,没有问题
发表于 2008-11-6 17:07 | 显示全部楼层
是不是你把函数给代用啦
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-23 03:30 , Processed in 0.054600 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表