?? lvqnet2.m
字號:
function LVQnet2()
%指定輸入二維向量及其類別并將這些類別轉化為學習向量量化網絡使用的目標向量,且繪制這些向量
X=[-3 -2 -2 0 0 0 0 2 2 3;0 1 -1 2 1 -1 -2 1 -1 0];
C=[1 1 1 2 2 2 2 1 1 1];
T=ind2vec(C);plotvec(X,C);
T
net=newlvq(minmax(X),4,[0.6 0.4],0.1)
w=net.iw{1};
figure;
plotvec(X,C);hold on;
plot(w(1,1),w(1,2),'ow');
xlabel('X(1),w(1)');ylabel('X(2),w(2)');
hold off;
net.trainParam.epochs=150;
net.trainParam.show=Inf;
net=train(net,X,T);
figure;plotvec(X,C);hold on;
plotvec(net.iw{1},vec2ind(net.lw{2}),'o')
X1=[0.8;0.3];
y1=sim(net,X1)
y=vec2ind(y1)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -