percept1.m
来自「多个感知器神经元的分类问题 %四类输入向量」· M 代码 · 共 34 行
M
34 行
%多个感知器神经元的分类问题
%四类输入向量
P=[0.1 0.7 0.8 0.8 1.0 0.3 0.0 -0.3 -0.5 -1.5;
1.2 1.8 1.6 0.6 0.8 0.5 0.2 0.8 -1.5 -1.3];
T=[1 1 1 0 0 1 1 1 0 0;
0 0 0 0 0 1 1 1 1 1];
net=newp([-2.5 2;-2.5 2],2);
figure;
watchon;
cla;
plotpv(P,T);
linehandle=plotpc(net.IW{1},net.b{1});
%训练该感知器神经网络
E=1;
net=init(net);
linehandle=plotpc(net.IW{1},net.b{1});
while(sse(E))
[net,Y,E]=adapt(net,P,T);
linehandle=plotpc(net.IW{1},net.b{1},linehandle);
drawnow;
end;
watchoff;
figure;
%验感器神经网络
p=[0.9;1.1];
a=sim(net,p);
Thepoint=findobj(gca,'type','line');
set(Thepoint,'color','red');
hold on;
plotpv(P,T);
plotpc(net.IW{1},net.b{1});
hold off;
disp('End of percept1');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?