huangxingaho 发表于 2008-11-7 15:23

各位大哥,请教一下如何在matlab中自定义传递函数i

各位大哥,请教一下如何在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),,{'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),,{'sigmoid''sigmoid'});
请务必指点
我想用神经网络来拟合随机变量函数参考的文献是《应用神经网络模拟随机变量的分布》

sigma665 发表于 2008-11-7 16:16

help newff

huangxingaho 发表于 2008-11-8 11:16

自己顶一下

其它问题都解决了。主要是输入数据要转置
关键是如何自定义传递函数还没搞明白
页: [1]
查看完整版本: 各位大哥,请教一下如何在matlab中自定义传递函数i