function [ret1,ret2,ret3,ret4]=nnd11bc(cmd,arg1,arg2,arg3,arg4,arg5)
% NND11BC Backpropagation calculation demonstration.
%
% This demonstration requires the Neural Network Toolbox.
%
% NND11BC runs this demo.
%
% NND11BC('set',W1,b1,W2,b2)
% sets the network's weight and bias values.
%
% [W1,b1,W2,b2] = NND11BC('get')
% gets the network's weight and bias values.
% Copyright 1994-2002 PWS Publishing Company and The MathWorks, Inc.
% $Revision: 1.7 $
% First Version, 8-31-95.
%==================================================================
% CONSTANTS
me = 'nnd11bc';
max_t = 0.5;
w_max = 10;
p_max = 2;
box_len = 40;
box_x = [0 1 1 0 0]*box_len;
box_y = [-1 -1 1 1 -1]*10;
pause_time = 1;
% FLAGS
change_func = 0;
% DEFAULTS
if nargin == 0, cmd = ''; else cmd = lower(cmd); end
% FIND WINDOW IF IT EXISTS
fig = nndfgflg(me);
if length(get(fig,'children')) == 0, fig = 0; end
% GET WINDOW DATA IF IT EXISTS
if fig
H = get(fig,'userdata');
fig_axis = H(1); % window axis
desc_text = H(2); % handle to first line of text sequence
W1_ptr = H(3);
b1_ptr = H(4);
W2_ptr = H(5);
b2_ptr = H(6);
p_name = H(7);
W11_box = H(8);
W11_text = H(9);
W11_name = H(10);
W12_box = H(11);
W12_text = H(12);
W12_name= H(13);
b11_box = H(14);
b11_text = H(15);
b11_name = H(16);
b12_box = H(17);
b12_text = H(18);
b12_name = H(19);
a11_name = H(20);
a12_name = H(21);
W21_box = H(22);
W21_text = H(23);
W21_name = H(24);
W22_box = H(25);
W22_text = H(26);
W22_name = H(27);
b2_box = H(28);
b2_text = H(29);
b2_name = H(30);
a2_name = H(31);
t_name = H(32);
e_name = H(33);
vars = H(34+[0:10]);
vals = H(45+[0:10]);
fp1_marker = H(56);
fp2_marker = H(57);
fp3_marker = H(58);
bp1_marker = H(59);
bp2_marker = H(60);
W1_marker = H(61);
b1_marker = H(62);
W2_marker = H(63);
b2_marker = H(64);
p_marker = H(65);
t_marker = H(66);
state_ptr = H(67);
p_ptr = H(68);
a1_ptr = H(69);
a2_ptr = H(70);
e_ptr = H(71);
s1_ptr = H(72);
s2_ptr = H(73);
t_ptr = H(74);
go_button = H(75);
s11_name = H(76);
s12_name = H(77);
s2_name = H(78);
blip_ptr = H(79);
bloop_ptr = H(80);
blp_ptr = H(81);
state1 = H(82);
state2 = H(83);
state3 = H(84);
state4 = H(85);
go_box = H(86);
last_text = H(87);
p_edit = H(88);
state = get(state_ptr,'userdata');
blip = get(blip_ptr,'userdata');
bloop = get(bloop_ptr,'userdata');
blp = get(blp_ptr,'userdata');
end
%==================================================================
% Activate the window.
%
% ME() or ME('')
%==================================================================
if strcmp(cmd,'')
if fig
figure(fig)
set(fig,'visible','on')
else
feval(me,'init')
end
%==================================================================
% Close the window.
%
% ME() or ME('')
%==================================================================
elseif strcmp(cmd,'close') & (fig)
delete(fig)
%==================================================================
% Initialize the window.
%
% ME('init')
%==================================================================
elseif strcmp(cmd,'init') & (~fig)
% CHECK FOR NNT
if ~nntexist(me), return, end
% CONSTANTS
W1 = [-0.27; -0.41];
b1 = [-0.48; -0.13];
W2 = [0.09 -0.17];
b2 = [0.48];
%%%%%%%% Copied from NNDEMOF2
s2 = 'DESIGN';
s3 = 'Backpropagation Calculation';
s4 = '';
s5 = 'Chapter 11';
fig = nnbg(me);
set(fig,'nextplot','add')
H = get(fig,'userdata');
h1 = H(1);
text(25,380,'Neural Network', ...
'color',nnblack, ...
'fontname','times', ...
'fontsize',16, ...
'fontangle','italic', ...
'fontweight','bold');
text(135,380,s2, ...
'color',nnblack, ...
'fontname','times', ...
'fontsize',16, ...
'fontweight','bold');
text(415,380,s3,...
'color',nnblack, ...
'fontname','times', ...
'fontsize',16, ...
'fontweight','bold',...
'HorizontalAlignment','right');
nndrwlin([0 415],[365 365],4,nndkblue);
h2 = text(390,315,'',...
'color',nnblack, ...
'fontname','helvetica', ...
'fontsize',10);
text1 = h2;
for i=1:30
text2 = text(390,315-6*i,'',...
'color',nnblack, ...
'fontname','helvetica', ...
'fontsize',10);
set(text1,'userdata',text2);
text1 = text2;
end
set(text1,'userdata','end');
text(410,54,s4, ...
'color',nnblack, ...
'fontname','times', ...
'fontsize',12, ...
'fontweight','bold');
text(410,38,s5, ...
'color',nnblack, ...
'fontname','times', ...
'fontsize',12, ...
'fontweight','bold');
nndrwlin([410 501],[24 24],4,nndkblue);
set(fig,'userdata',[h1 h2])
set(fig,'color',nndkgray,'color',nnltgray)
%%%%%%%%
set(fig, ...
'windowbuttondownfcn',nncallbk(me,'down'), ...
'BackingStore','off');
H = get(fig,'userdata');
fig_axis = H(1);
desc_text = H(2);
% ICON
nndicon(11,458,363,'shadow')
% NETWORK POSITIONS
x1 = 30; % input
x2 = x1+85; % 1st layer sum
x3 = x2+70; % 1st layer transfer function
x4 = x3+125; % 2nd layer sum
x5 = x4+55; % 2nd layer transfer function
x6 = x5+50; % output
y1 = 305; % top neuron
y2 = y1-20; % input & output neuron
y3 = y1-40; % bottom neuron
sz = 15; % size of icons
wx = 50; % weight horizontal offset (from 1st layer)
wy = 40; % weight vertical offset (from middle)
% NETWORK INPUT
p_name = nndtext(x1-10,y2,'p');
set(p_name,'fontsize',10);
% TOP NEURON: WEIGHT
plot([x1 x1+20],[y2 y1],'linewidth',2,'color',nnred);
W11_box = fill(x1+20+box_x,y1+box_y,nnltgray,...
'linewidth',2,...
'edgecolor',nnred,...
'erasemode','none');
W11_text = nndtext(x1+20+box_len/2,y1,sprintf('%5.3f',W1(1)));
set(W11_text,'fontsize',10);
plot([x1+20+box_len x2-sz],[y1 y1],'linewidth',2,'color',nnred);
W11_name = nndtext(x2-wx,y2+wy,'W1(1,1)');
set(W11_name,'fontsize',10);
% TOP NEURON: BIAS
plot([x2 x2 x3],[y1+sz*2 y1 y1],'linewidth',2,'color',nnred);
b11_box = fill(x2-box_len/2+box_x,y1+sz*2+10+box_y,nnltgray,...
'linewidth',2,...
'edgecolor',nnred,...
'erasemode','none');
b11_text = nndtext(x2,y1+sz*2+10,sprintf('%5.3f',b1(1)));
set(b11_text,'fontsize',10);
b11_name = nndtext(x2+25,y1+sz*2+10,'b1(1)','left');
set(b11_name,'fontsize',10);
% TOP NEURON: BODY
nndsicon('sum',x2,y1,sz)
n11_name = nndtext(x2+sz+20,y1+10,'n1(1)');
set(n11_name,'fontsize',10);
nndsicon('logsig',x3,y1,sz)
s11_name = nndtext(x2+sz+75,y1+40,'s1(1)');
set(s11_name,'fontsize',10);
plot(x2+sz+[30 60],y1+[18 32],'--',...
'color',nnred,...
'linewidth',2,...
'erasemode','none')
a11_name = nndtext(x3+sz+20,y1+10,'a1(1)');
set(a11_name,'fontsize',10);
% BOTTOM NEURON: WEIGHT
plot([x1 x1+20],[y2 y3],'linewidth',2,'color',nnred);
W12_box = fill(x1+20+box_x,y3+box_y,nnltgray,...
'linewidth',2,...
'edgecolor',nnred,...
'erasemode','none');
W12_text = nndtext(x1+20+box_len/2,y3,sprintf('%5.3f',W1(2)));
set(W12_text,'fontsize',10);
plot([x1+20+box_len x2-sz],[y3 y3],'linewidth',2,'color',nnred);
W12_name = nndtext(x2-wx,y2-wy,'W1(2,1)');
set(W12_name,'fontsize',10);
% BOTTOM NEURON: BIAS
plot([x2 x2 x3],[y3-sz*2 y3 y3],'linewidth',2,'color',nnred);
b12_box = fill(x2-box_len/2+box_x,y3-sz*2-10+box_y,nnltgray,...
'linewidth',2,...
'edgecolor',nnred,...
'erasemode','none');
b12_text = nndtext(x2,y3-sz*2-10,sprintf('%5.3f',b1(2)));
set(b12_text,'fontsize',10);
b12_name = nndtext(x2+25,y3-sz*2-10,'b1(2)','left');
set(b12_name,'fontsize',10);
% BOTTOM NEURON: BODY
nndsicon('sum',x2,y3,sz)
n12_name = nndtext(x2+sz+20,y3-10,'n1(2)');
set(n12_name,'fontsize',10);
nndsicon
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
神经网络学习过程的实例 (278个子文件)
demolin1_img03.gif 25KB
demolin1_img06.gif 25KB
demolin7_img06.gif 20KB
demolin4_img06.gif 20KB
demolin4_img03.gif 20KB
demolin7_img03.gif 20KB
demolin2_img06.gif 20KB
demolin2_img03.gif 20KB
demolin5_img07.gif 17KB
demolin5_img03.gif 17KB
demolin5_img06.gif 17KB
demosm2_img02.gif 11KB
demohop3_img07.gif 9KB
demosm2_img05.gif 7KB
demohop1_img08.gif 6KB
demolin8_img05.gif 5KB
demorb3_img04.gif 5KB
demorb1_img04.gif 5KB
demolin8_img03.gif 5KB
demolin5_img08.gif 4KB
demolin2_img07.gif 4KB
demolin7_img07.gif 4KB
demohop3_img08.gif 4KB
demorb1_img06.gif 4KB
demorb4_img04.gif 4KB
demolin6_img06.gif 4KB
demohop3_img06.gif 4KB
demogrn1_img05.gif 4KB
demohop2_img07.gif 4KB
demolin4_img07.gif 4KB
demopnn1_img06.gif 4KB
demohop3_img03.gif 4KB
demorb1_img03.gif 4KB
democ1_img02.gif 3KB
demosm1_img02.gif 3KB
democ1_img04.gif 3KB
demosm1_img05.gif 3KB
democ1_img03.gif 3KB
demolvq1_img06.gif 3KB
demorb1_img02.gif 3KB
demorb3_img02.gif 3KB
demorb4_img02.gif 3KB
demop4_img08.gif 3KB
demop6_img05.gif 3KB
demop4_img05.gif 3KB
demolvq1_img05.gif 3KB
demop5_img08.gif 3KB
demop1_img07.gif 3KB
demop4_img09.gif 3KB
demop5_img05.gif 3KB
demop1_img05.gif 3KB
demogrn1_img03.gif 3KB
demogrn1_img04.gif 3KB
demop5_img09.gif 3KB
demohop2_img06.gif 3KB
demop1_img06.gif 3KB
demop5_img07.gif 3KB
demop4_img07.gif 3KB
demopnn1_img05.gif 3KB
demohop1_img07.gif 3KB
demolvq1_img03.gif 3KB
demohop1_img03.gif 3KB
demohop2_img03.gif 3KB
demop6_img04.gif 3KB
demop6_img02.gif 3KB
demogrn1_img02.gif 3KB
demopnn1_img02.gif 3KB
demopnn1_img04.gif 3KB
demop5_img02.gif 3KB
demop5_img04.gif 3KB
demop4_img04.gif 3KB
demop4_img02.gif 3KB
demop1_img04.gif 3KB
demop1_img02.gif 3KB
demosm2_img04.gif 2KB
demolin5.html 11KB
demop5.html 11KB
demop4.html 11KB
demolin4.html 10KB
demolin7.html 10KB
demohop3.html 10KB
demolin2.html 9KB
demopnn1.html 9KB
demorb1.html 9KB
demohop1.html 8KB
demohop2.html 8KB
demolin6.html 8KB
demop1.html 8KB
demolvq1.html 7KB
democ1.html 7KB
demosm2.html 7KB
demorb4.html 7KB
demosm1.html 6KB
demolin1.html 6KB
demop6.html 6KB
demogrn1.html 6KB
demolin8.html 6KB
demorb3.html 5KB
demohop4.html 4KB
nnd11bc.m 37KB
共 278 条
- 1
- 2
- 3
资源评论
- zpzxd2014-04-15还不错,有一定的帮助
- 小白象3652011-09-15不是c语言写的,
- happyfaye2014-09-12还可以,有助于理解
LOSINBIN
- 粉丝: 2
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Pytorch-pytorch深度学习教程之前馈神经网络.zip
- Pytorch-pytorch深度学习教程之线性回归.zip
- Pytorch-pytorch深度学习教程之基本操作.zip
- 基于QT的地图可视化桌面系统后台数据库为MySQL5.7源码.zip
- 基于simulink的PLL锁相环系统仿真【包括模型,文档,参考文献,操作步骤】
- 基于EM-GMM模型的目标跟踪和异常行为检测matlab仿真【包括程序,注释,参考文献,操作步骤,说明文档】
- 2109010044_胡晨燕_选课管理数据库设计与实现.prj
- 帕鲁介绍的PPT备份没什么好下的
- demo1-202405
- 两种方式修改Intel网卡MAC地址
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功