• 大小: 448KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-13
  • 语言: 其他
  • 标签: 创新  

资源简介

粒子群算法PSO和万有引力算法GSA结合优化FNN神经网络进行标准数据集的分类,可运行

资源截图

代码片段和文件信息

%  Traning Feed-forward Neural Networks using Grey Wolf Optimizer   %
%                                                                   %
%  Developed in MATLAB R2011b(7.13)                                 %
%                                                                   %
%  Author and programmer: Seyedali Mirjalili                        %
%                                                                   %
%         e-Mail: ali.mirjalili@gmail.com                           %
%                 seyedali.mirjalili@griffithuni.edu.au             %
%                                                                   %
%       Homepage: http://www.alimirjalili.com                       %
%                                                                   %
%   Main paper: S. MirjaliliHow effective is the Grey Wolf         %
%               optimizer in training multi-layer perceptrons       %
%              Applied Intelligece in press 2015                 %
%               http://dx.doi.org/10.1007/s10489-014-0645-7         %
%                                                                   %

% This function containts full information and implementations of the
% datasets

% lb is the lower bound: lb=[lb_1lb_2...lb_d]
% up is the uppper bound: ub=[ub_1ub_2...ub_d]
% dim is the number of variables (dimension of the problem)

function [lbubdimfobj] = Get_Functions_details(F)


switch F       
   case ‘F1‘
        fobj=@MLP_XOR
        lb=-10;
        ub=10;
        dim=36;
        
    case ‘F2‘
        fobj = @MLP_Baloon;
        lb=-10;
        ub=10;
        dim=55;   
        
    case ‘F3‘
        fobj=@MLP_Iris
        lb=-10;
        ub=10;
        dim=75;
        
    case ‘F4‘
        fobj=@MLP_Cancer
        lb=-10;
        ub=10;
        dim=209;
        
     case ‘F5‘
        fobj=@MLP_Heart
        lb=-10;
        ub=10;
        dim=1081;       
        
     case ‘F6‘
        fobj=@MLP_Sigmoid
        lb=-10;
        ub=10;
        dim=46; 
        
     case ‘F7‘
        fobj=@MLP_Cosine
        lb=-10;
        ub=10;
        dim=46;    
        
     case ‘F8‘
         fobj=@MLP_Sine
         lb=-10;
         ub=10;
         dim=46;
        
     case ‘F9‘
         fobj=@MLP_Sphere
         lb=-10;
         ub=10;
         dim=61;
         
end

end

function o=MLP_Baloon(solution)

load baloon.txt
 x=sortrows(baloon2);
 %I2=x(1:1501:4);
 I2(:1)=x(1:201);
 I2(:2)=x(1:202);
 I2(:3)=x(1:203);
 I2(:4)=x(1:204);
 T=x(1:205);

Hno=9;
dim = 6*9+1;                      % Dimension of the problem

   o  = 0;
        for ww=1:45
            W(ww)=solution(1ww);
        end
        for bb=46:55
            B(bb-45)=solution(1bb);
        end        
        fitness=0;
        for pp=1:20
            actualvalue=my_simulate(491WBI2(pp:));

                fitness=fitness+(T(pp)-actualvalue)^2;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         218  2011-06-05 12:52  NNGWO\Baloon.txt
     文件       20586  2011-06-06 16:31  NNGWO\Cancer.txt
     文件       10212  2015-07-26 01:29  NNGWO\Get_Functions_details.m
     文件        4178  2015-07-26 01:29  NNGWO\GWO.m
     文件      438013  2015-02-20 21:31  NNGWO\GWOMLP.png
     文件        3758  2011-06-04 16:01  NNGWO\Heart.txt
     文件        1703  2015-07-26 01:34  NNGWO\initialization.m
     文件        2850  2010-10-14 01:44  NNGWO\Iris.txt
     文件        1319  2015-07-26 01:34  NNGWO\license.txt
     文件       15858  2015-07-26 00:22  NNGWO\main.asv
     文件       14453  2015-07-26 01:37  NNGWO\main.m
     文件        1192  2015-07-26 01:35  NNGWO\My_sigmoid.m
     文件        1555  2015-07-26 01:28  NNGWO\my_simulate.m
     文件        1378  2015-07-26 01:34  NNGWO\my_simulate_2_inputs.m

评论

共有 条评论