📄 fmap2.m
字号:
%例6.6,fmap2.m
%
clear
P=rands(2,2000)*0.5;
x=0:0.1:3.1416*2;
plot(sin(x),cos(x)); %画圆
axis('equal')
hold on
plot(P(1,:),P(2,:),'.g','markersize',10); %画输入点
hold off
disp('按任一键继续')
pause
net=newsom(minmax(P),[5,5]); %创建科荷伦网络
W0=rands(25,2)*0.1; %随机产生权值
figure(2)
plot(sin(x),cos(x));
axis('equal')
hold on
plotsom(W0') %作神经元权值图
hold off
disp('按任一键继续')
pause
net.trainParam.epochs=25; %最大训练次数
net.trainParam.show=5; %显示间隔次数
net.iw{1,1}=W0; %赋权值
net = train(net,P); %训练网络
figure(3)
plot(sin(x),cos(x),'--');
hold on
plotsom(net.iw{1,1},net.layers{1}.distances)
%画权值点及其与相邻权值点的连线
hold off
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -