?? trainsomnet.m
字號:
function [Net,Jd,JdCycle]=TrainSOMNet(Net,KernelType)
R=Net.VectorDim;%向量數
Q=Net.VectorNum;%向量數
ClassNum=Net.ClassNum;%分類類別數
MaxCycle=Net.MaxCycle;%最大循環次數
Lr=Net.Lr;%學習率
Winner=Net.Winner;%獲勝類別
CurrentVector=Net.CurrentVector;%當前類別
cycle=1;
Jd=[];
JdCycle=[];
NeighbourHood=int16(ClassNum);
while(cycle<=MaxCycle)%循環計算次數
x=(cycle/MaxCycle);
LR=(1-x)*Lr;%計算每次的學習率
Net=TrainUnits(Net,LR,NeighbourHood,KernelType);
NeighbourHood=max([ceil(NeighbourHood*(1-4*x)) 1]);
fprintf(1,'Step %ld\n',cycle);
cycle=cycle+1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[accurate]=100-GetAccurate(Net);
Jd=[Jd;accurate];
JdCycle=[JdCycle;cycle-1];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -