3-2.m

来自「神经网络理论与MATLAB7这本书的各章节的源程序」· M 代码 · 共 17 行

M
17
字号
P = [ -0.5 -0.5 +0.3 -0.1 -0.8; ...
      -0.5 +0.5 -0.5 +1.0 +0.0 ];
T = [1 1 0 0 0];
plotpv(P,T);
net = newp([-40 1;-1 50],1);
%对训练前的样本进行绘图,并获得绘图的句柄linehandle
hold on
plotpv(P,T);
linehandle=plotpc(net.IW{1},net.b{1});
%设定自适应循环次数为3
net.adaptParam.passes = 3;
linehandle=plotpc(net.IW{1},net.b{1});
for a = 1:25
   [net,Y,E] = adapt(net,P,T);
   linehandle = plotpc(net.IW{1},net.b{1},linehandle);  drawnow;
end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?