91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

果蠅優(yōu)化算法matlab程序,適應(yīng)度函數(shù)請(qǐng)下載AdaptFunc.m。應(yīng)用環(huán)境LSSVMlabv1_8_R2009b_R2011a。

資源截圖

代碼片段和文件信息

function?[gamreturn?sig2return]?=?foa(maxgensizepop)

global?X;
global?Y;
global?Xt;
global?Yt;
global?mseprocess2;
global?mseprocess3;

??
X_axis=100*rand(12);
Y_axis=100*rand(12);

%?maxgen=7;?
%?sizepop=20;?
%B=0;

disp(‘開(kāi)始初始計(jì)算‘);
Smellbest=1000;%Smellbest初始值


for?gen=1:maxgen????


??for?i=1:sizepop
??????
??????
%????????g=0;%誤差平方和
??????%初始化果蠅個(gè)體飛行距離
??????x(i:)=X_axis+20*rand()-15;
??????y(i:)=Y_axis+20*rand()-15;

?????%求出與原點(diǎn)的距離
?????D(i1)=(x(i1)^2+y(i1)^2)^0.5;?
?????D(i2)=(x(i2)^2+y(i2)^2)^0.5;

%求味道濃度
??????S(i1)=1/D(i1);
??????S(i2)=1/D(i2);
%設(shè)定LSSVM參數(shù)值
%??????type?=?‘function?estimation‘;
?????gam(i)=150*S(i1);
?????sig2(i)=0.1*S(i2);
????%開(kāi)始訓(xùn)練
%?????[alphab]?=?trainlssvm({X1Y1typegamsig2‘RBF_kernel‘});
%?????Yt?=?simlssvm({X1Y1typegamsig2‘RBF_kernel‘‘preprocess‘}{alphab}Xt);
%?????eer=Yt-Ytr;
%?????for?j=1:length(Xt)
%??????????g=g+eer(j)^2;
%?????end
%??????Smell(i)=g/length(Xt);
Smell(i)=1/AdaptFunc(gam(i)sig2(i));
?????
??end
%???max(gam)
??[bestSmell?bestindex]=min(Smell);

???if?bestSmell?????????X_axis=x(bestindex);
?????????Y_axis=y(bestindex);
?????????Smellbest=bestSmell;
?????????gamreturn=150*S(bestindex1)
?????????sig2return=0.1*S(bestindex2)
???end
???%
??mseprocess2(gen)=Smellbest;?
???Xbest(gen)=X_axis;
???Ybest(gen)=Y_axis;
???
end

%?gamreturn
%
figure(1);
plot(mseprocess2);


end

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????1504??2014-02-06?21:41??foa.m

評(píng)論

共有 條評(píng)論