声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1265|回复: 2

[编程技巧] 各位大哥,请教一下如何在matlab中自定义传递函数i

[复制链接]
发表于 2008-11-7 15:23 | 显示全部楼层 |阅读模式

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

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

x
各位大哥,请教一下如何在matlab中自定义传递函数i我在网上看了个函数逼近的bp神经网络程序 x=[610
620
630
640
660
664
673
680
700
720
730
745
750
760
766
];
y=[ 0.9999511393
0.9999546294
0.9999581194
0.9999616095
0.9999650995
0.9999685896
0.9999720796
0.9999755697
0.9999790597
0.9999825498
0.9999860398
0.9999895299
0.9999930199
0.9999965100
1.0000000000];
net=newff(minmax(x),[3,1],{'tansig''purelin'});
y1=sim(net,x);
net.trainParam.epochs=50;
net.trainParam.goal=1e-10;
net=train(net,x,y);
y2=sim(net,x);
figure;
plot(x,y,'.',x,y1,'-',x,y2,'+')
title;
xlable('x');ylable('y');
通过另一篇文献,我知道要用sigmoid函数作为传递函数
所以我自定义
sigmoid.m
function y(i)=sigmoid(x(i))
y(i)=1/(1+exp(-x(i)));
运行后出现
??? Error using ==> network.subsasgn
"layers{1}.transferFcn" cannot be set to non-existing function "sigmoid'sigmoid".
Error in ==> newff at 145
  net.layers{i}.transferFcn = tf{i};
Error in ==> distrubution at 23436
net=newff(minmax(x),[3,1],{'sigmoid''sigmoid'});
请务必指点
我想用神经网络来拟合随机变量函数参考的文献是《应用神经网络模拟随机变量的分布》
回复
分享到:

使用道具 举报

发表于 2008-11-7 16:16 | 显示全部楼层
help newff

评分

1

查看全部评分

 楼主| 发表于 2008-11-8 11:16 | 显示全部楼层

自己顶一下

其它问题都解决了。主要是输入数据要转置
关键是如何自定义传递函数还没搞明白

评分

1

查看全部评分

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-5-16 14:11 , Processed in 0.299130 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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