📄 percept2.m
字号:
%奇异样本对感知器神经网络训练的影响
P=[-0.5 -0.5 0.3 -0.1 -30;
-0.5 0.5 -0.5 1.0 40];
T=[1 1 0 0 1];
plotpv(P,T);
%创建感知器神经网络
net=newp([-30 1;-1 40],1);
disp('please put any key to go on');
pause
plotpv(P,T);
linehandle=plotpc(net.IW{1},net.b{1});
cla;
plotpv(P,T);
linehandle=plotpc(net.IW{1},net.b{1});
%训练该网络
E=1;
net.adaptParam.passes=1;
net=init(net);
linehandle=plotpc(net.IW{1},net.b{1});
time=0;
while(sse(E))
time=time+1;
[net,Y,E]=adapt(net,P,T);
linehandle=plotpc(net.IW{1},net.b{1},linehandle);
drawnow;
end;
disp('please put any key to go on');
pause
%检验该网络性能
p=[0.5;1.6];
a=sim(net,p);
plotpv(p,a);
ThePoint=findobj(gca,'type','line');
set(ThePoint,'Color','red');
hold on;
plotpv(P,T);
plotpc(net.IW{1},net.b{1});
hold off;
axis([-2 2 -2 2]);
disp('end of percetp2');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -