?? fmap1.m
字號(hào):
%例6.5,fmap1.m
%
clear
pi=3.1416;
x=0:0.5*pi/99:0.5*pi;
P=[sin(x);cos(x)]; %畫圓
plot(P(1,:),P(2,:),'b.'); %畫輸入點(diǎn)圖
axis('equal')
[R,Q]=size(P);
S=20;
W0=rands(S,R)*0.1; %隨機(jī)產(chǎn)生權(quán)值
hold on
plotsom(W0') %畫權(quán)值點(diǎn)及其與相鄰權(quán)值點(diǎn)的連線
hold off
disp('按任一鍵繼續(xù)')
pause
net=newsom(minmax(P),S); %創(chuàng)建科荷倫網(wǎng)絡(luò)
net.trainParam.epochs=200; %最大訓(xùn)練次數(shù)
net.trainParam.show = 20;
net = train(net,P); %訓(xùn)練網(wǎng)絡(luò)
figure(2)
plot(P(1,:),P(2,:),'.g','markersize',20) %畫輸入點(diǎn)
hold on
plotsom(net.iw{1,1},net.layers{1}.distances)
%作訓(xùn)練后的權(quán)值點(diǎn)及其與相鄰權(quán)值點(diǎn)的連線
hold off
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -