First, Harris Eagle algorithm

2. Improved Harris Eagle optimization algorithm based on multi-strategy

In order to solve the problem that the basic Harris Hawks optimization (HHO) algorithm is easy to fall into local optimization and the convergence accuracy is low, a multi-strategy Harris Hawks optimization algorithm is proposed. MHHO). In the exploration stage, cauchy distribution function was introduced to change the global position to increase the diversity of the population. In the transition stage, the stochastic shrinkage exponential function is used to nonlinear energy equation to better coordinate global exploration and local mining. In the mining stage, the adaptive weight factor is introduced to update the local position and improve the local mining capacity. By solving multiple single-peak, multi-peak and high-dimensional test functions, the results show that the MHHO algorithm combining the three strategies has better optimization accuracy and stability.

Three, part of the code

function [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = elm_kernel(TrainingData, TestingData, Elm_Type, Regularization_coefficient, Kernel_type, Kernel_para) % Usage: elm(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction) % OR: [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy] = elm(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction) % % Input: % TrainingData_File - Filename of training data set tic; Omega_test = kernel_matrix(P',Kernel_type, Kernel_para,TV.P'); TY=(Omega_test' * OutputWeight)'; % TY: the actual output of the testing data TestingTime=toc %%%%%%%%%% Calculate training & testing classification accuracy if  Elm_Type == REGRESSION %%%%%%%%%% Calculate training & testing accuracy (RMSE) for regression case TrainingAccuracy=sqrt(mse(T - Y)) TestingAccuracy=sqrt(mse(TV.T - TY)) end if Elm_Type == CLASSIFIER %%%%%%%%%% Calculate training & testing classification accuracy MissClassificationRate_Training=0; MissClassificationRate_Testing=0; for i = 1 : size(T, 2) [x, label_index_expected]=max(T(:,i)); [x, label_index_actual]=max(Y(:,i)); if label_index_actual~=label_index_expected MissClassificationRate_Training=MissClassificationRate_Training+1; end end TrainingAccuracy=1-MissClassificationRate_Training/size(T,2) for i = 1 : size(TV.T, 2) [x, label_index_expected]=max(TV.T(:,i)); [x, label_index_actual]=max(TY(:,i)); if label_index_actual~=label_index_expected MissClassificationRate_Testing=MissClassificationRate_Testing+1; end end TestingAccuracy=(1-MissClassificationRate_Testing/size(TV.T,2))*100 end %%%%%%%%%%%%%%%%%% Kernel Matrix %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function omega = kernel_matrix(Xtrain,kernel_type, kernel_pars,Xt) nb_data = size(Xtrain,1); If STRCMP (kernel_type,'RBF_kernel'), if nargin<4, XXh = sum(Xtrain.^2,2)*ones(1,nb_data); omega = XXh+XXh'-2*(Xtrain*Xtrain'); omega = exp(-omega./kernel_pars(1)); The else XXh1 = sum (Xtrain. ^ 2, 2) * ones (1, the size (Xt, 1)); XXh2 = sum (Xt. ^ 2, 2) * ones (1, nb_data); omega = XXh1+XXh2' - 2*Xtrain*Xt'; omega = exp(-omega./kernel_pars(1)); end elseif strcmp(kernel_type,'lin_kernel') if nargin<4, omega = Xtrain*Xtrain'; else omega = Xtrain*Xt'; end elseif strcmp(kernel_type,'poly_kernel') if nargin<4, omega = (Xtrain*Xtrain'+kernel_pars(1)).^kernel_pars(2); else omega = (Xtrain*Xt'+kernel_pars(1)).^kernel_pars(2); End elseif STRCMP (kernel_type,'wav_kernel') if nargin<4, XXh = sum(Xtrain.^2,2)*ones(1,nb_data); omega = XXh+XXh'-2*(Xtrain*Xtrain'); XXh1 = sum(Xtrain,2)*ones(1,nb_data); omega1 = XXh1-XXh1'; omega = cos(kernel_pars(3)*omega1./kernel_pars(2)).*exp(-omega./kernel_pars(1)); The else XXh1 = sum (Xtrain. ^ 2, 2) * ones (1, the size (Xt, 1)); XXh2 = sum (Xt. ^ 2, 2) * ones (1, nb_data); omega = XXh1+XXh2' - 2*(Xtrain*Xt'); XXh11 = sum(Xtrain,2)*ones(1,size(Xt,1)); XXh22 = sum(Xt,2)*ones(1,nb_data); omega1 = XXh11-XXh22'; omega = cos(kernel_pars(3)*omega1./kernel_pars(2)).*exp(-omega./kernel_pars(1)); end endCopy the code

4. Simulation results

[1] Guo Yuxin, Liu Sheng, Gao Wenxin, Zhang Lei. Multi-strategy Improved Harris Eagle Optimization Algorithm [J]. Microelectronics and Computer, 201,38(07):18-24.