附加动量法BP网络MATLAB程序

上传人:公**** 文档编号:495524993 上传时间:2023-12-03 格式:DOC 页数:2 大小:35KB
返回 下载 相关 举报
附加动量法BP网络MATLAB程序_第1页
第1页 / 共2页
附加动量法BP网络MATLAB程序_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《附加动量法BP网络MATLAB程序》由会员分享,可在线阅读,更多相关《附加动量法BP网络MATLAB程序(2页珍藏版)》请在金锄头文库上搜索。

1、clear all ;P=-6.0 -6.1 -4.1 -4.0 5.0 -5.1 6.0 6.1;T=0 0 0.97 0.99 0.01 0.03 1.0 1.0;R,Q=size(P);S,Q=size(T);disp( The bias B is fixed at 300 and will not learn)Z1=menu( Initialize Weight with:, .W0=-0.9;B0=3; , .Pick Values with Mouse/Arrow Keys, .Random Initial ConditionDefault; );disp( )B0=3;if Z1

2、=1W0=-0.9;elseif Z1=3W0=rand(S,R);enderror1=;net=newcf(minmax(P),1, logsig ); net.b1=B0;j=-1:0.1:1;for i=1:21;net.iw1,1=j(i); y=sim(net,P); err=sumsqr(y-T);error1=error1 err;endplot(j,error1);xlabel( Input Vector );ylabel( One Dimention Error Curve ) hold on;Z2=menu( Use momentum constant of :, .0.0

3、 , .0.95 Default );if Z1=2 W0,dummy=ginput(1);end disp( ) if Z2=1 momentum=0;else momentum=0.95;end ls=;error=;w=; max_epoch=500;err_goal=0.01;lp.lr=0.05;lp.mc=momentum;err_ratio=1.04;W=W0;B=B0;A=logsig(W0*P+B0*ones(1,8);E=T-A;SSE=sumsqr(E);for epoch=1:max_epoch if SSESSE*err_ratio mc=0;elseif TSSESSE mc=momentum;end W=TW;A=TA; E=TE; SSE=TSSE; error=error TSSE; w=w W;endplot(w,error, rp xlabel( Input Vector hold off ;););ylabel(Weight );figure;plot(error);xlabel( Input Vector);ylabel(Training Error);

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 解决方案

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号