newcf函数的误差、权值情况

newcf函数的误差、权值情况

%newcf函数的误差、权值情况 % bp网络的误差变化和权值情况 P=[-6 -6.1 -4.1 -4 4 4.1 6 6.1]; T=[0.0 0.0 0.97 0.99 0.01 0.03 1 1]; %创建前向BP网络 net=newcf(minmax(P),[1],{'tansig'},'traingd'); net.iw{1,1}; net.b{1}; net.trainParam.epochs=300; %初始化训练次数 net.trainParam.lr=0.05; [net tr]=train(net,P,T); %训练网络 w1=net.iw{1,1}; b1=net.b{1}; Wrange=-1:0.1:1; Brange=-2:0.2:2; %W值的行向量、B值的行向量 ES=errsurf(P,T,Wrange,Brange,'logsig'); %求单神经元的误差平面(只用在单神经元中) mesh(ES,[60,30]); %作三维网状面,视角【60,30】 title('Error Surface Graph') xlabel('W'); ylabel('B'); zlabel('Error') figure(2) [C,h] =contour(Wrange,Brange,ES,6); %作等高线图,ES为高 %返回等高线矩阵C,列向量h是线或对象的句柄, %一条线一个句柄,这些被用作CLABEL的输入, %每个对象包含每个等高线的高度 clabel(C,h) %标上高度值 colormap cool %背景的颜色cool xlabel('W'); ylabel('B'); figure(3); plot(w1,b1,'rv') figure(4); plot(tr.perf) %画误差曲线

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
新版Matlab中神经网络训练函数Newff的详细讲解-新版Matlab中神经网络训练函数Newff的使用方法.doc 本帖最后由 小小2008鸟 于 2013-1-15 21:42 编辑 新版Matlab中神经网络训练函数Newff的详细讲解 一、   介绍新版newffSyntax·          net = newff],{TF1 TF2...TFNl}, BTF,BLF,PF,IPF,OPF,DDF) Descriptionnewff],{TF1 TF2...TFNl}, BTF,BLF,PF,IPF,OPF,DDF) takes several arguments PR x Q1 matrix of Q1 sample R-element input vectorsTSN x Q2 matrix of Q2 sample SN-element target vectorsSiSize of ith layer, for N-1 layers, default = [ ]. TFiTransfer function of ith layer. (Default = 'tansig' for hidden layers and 'purelin' for output layer.)BTFBackpropagation network training function BLFBackpropagation weight/bias learning function IPFRow cell array of input processing functions. OPFRow cell array of output processing functions. DDFData divison function ExamplesHere is a problem consisting of inputs P and targets T to be solved with a network.·          P = [0 1 2 3 4 5 6 7 8 9 10];T = [0 1 2 3 4 3 2 1 2 3 4];Here a network is created with one hidden layer of five neurons.·          net = newff;The network is simulated and its output plotted against the targets.·          Y = sim;plotThe network is trained for 50 epochs. Again the network's output is plotted.·          net.trainParam.epochs = 50;net = train;Y = sim; plot 二、   新版newff与旧版newff调用语法对比 Example1比如输入input(6*1000),输出output为(4*1000),那么旧版定义:net=newff,[14,4],{'tansig','purelin'},'trainlm');新版定义:net=newff; Example2比如输入input(6*1000),输出output为(4*1000),那么旧版定义:net=newff,[49,10,4],{'tansig','tansig','tansig'},'traingdx');新版定义:net=newff; 更详细请看word文档 新版Matlab中神经网络训练函数Newff的使用方法.doc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值