?? 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 + -