欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 焦点 > GA优化后的RBF神经网络

GA优化后的RBF神经网络

2024/12/27 6:18:24 来源:https://blog.csdn.net/weixin_58438203/article/details/144274572  浏览:    关键词:GA优化后的RBF神经网络

遗传算法(Genetic Algorithm, GA)优化后的RBF(Radial Basis Function)神经网络是一种结合进化算法与神经网络的混合模型,用于改进RBF神经网络的性能。以下是该模型的基本原理和相关公式:

clear all
close allG = 15;
Size = 30;
CodeL = 10;for i = 1:3MinX(i) = 0.1*ones(1);MaxX(i) = 3*ones(1);
end
for i = 4:1:9MinX(i) = -3*ones(1);MaxX(i) = 3*ones(1);
end
for i = 10:1:12MinX(i) = -ones(1);MaxX(i) = ones(1);
endE = round(rand(Size,12*CodeL));  %Initial Code!BsJ = 0;for kg = 1:1:Gtime(kg) = kgfor s = 1:1:Sizem = E(s,:);for j = 1:1:12y(j) = 0;mj = m((j-1)*CodeL + 1:1:j*CodeL);for i = 1:1:CodeLy(j) = y(j) + mj(i)*2^(i-1);endf(s,j) = (MaxX(j) - MinX(j))*y(j)/1023 + MinX(j);end% ************Step 1:Evaluate BestJ *******************p = f(s,:);[p,BsJ] = RBF(p,BsJ);BsJi(s) = BsJ;end[OderJi,IndexJi] = sort(BsJi);BestJ(kg) = OderJi(1);BJ = BestJ(kg);Ji = BsJi+1e-10;fi = 1./Ji;[Oderfi,Indexfi] = sort(fi);Bestfi = Oderfi(Size);BestS = E(Indexfi(Size),:);% ***************Step 2:Select and Reproduct Operation*********fi_sum = sum(fi);fi_Size = (Oderfi/fi_sum)*Size;fi_S = floor(fi_Size);kk = 1;for i = 1:1:Sizefor j = 1:1:fi_S(i)TempE(kk,:) = E(Indexfi(i),:);kk = kk + 1;endend% ****************Step 3:Crossover Operation*******************pc = 0.60;n = ceil(20*rand);for i = 1:2:(Size - 1)temp = rand;if pc>tempfor j = n:1:20TempE(i,j) = E(i+1,j);TempE(i+1,j) = E(i,j);endendendTempE(Size,:) = BestS;E = TempE;%*****************Step 4:Mutation Operation*********************pm = 0.001 - [1:1:Size]*(0.001)/Size;for i = 1:1:Sizefor j = 1:1:12*CodeLtemp = rand;if pm>tempif TempE(i,j) == 0TempE(i,j) = 1;elseTempE(i,j) = 0;endendendend%Guarantee TempE(Size,:) belong to the best individualTempE(Size,:) = BestS;E = TempE;%********************************************************************endBestfiBestSfiBest_J = BestJ(G)figure(1);plot(time,BestJ);xlabel('Times');ylabel('BestJ');save pfile p;

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com