1 简介
人工神经网络的最大缺点是训练时间太长从而限制其实时应用范围,近年来,极限学习机(Extreme Learning Machine, ELM)的提出使得前馈神经网络的训练时间大大缩短,然而当原始数据混杂入大量噪声变量时,或者当输入数据维度非常高时,极限学习机算法的综合性能会受到很大的影响.深度学习算法的核心是特征映射,它能够摒除原始数据中的噪声,并且当向低维度空间进行映射时,能够很好的起到对数据降维的作用,因此我们思考利用深度学习的优势特性来弥补极限学习机的弱势特性从而改善极限学习机的性能.为了进一步提升DELM预测精度,本文采用探路者算法进一步优化DELM超参数,仿真结果表明,改进算法的预测精度更高。
![【DELM预测】基于探路者算法改进深度学习极限学习机实现数据预测附matlab代码_深度学习_02](https://s2.51cto.com/images/202205/967afde8854d272f9bf739f46171d1cb7e25de.gif)
![【DELM预测】基于探路者算法改进深度学习极限学习机实现数据预测附matlab代码_原始数据_04](https://s2.51cto.com/images/202205/658562973d00117ffcf57951b40c41f6c31eb8.gif)
![【DELM预测】基于探路者算法改进深度学习极限学习机实现数据预测附matlab代码_原始数据_06](https://s2.51cto.com/images/202205/93288c97940e31f339d08780b5ba196d47bb33.gif)
![【DELM预测】基于探路者算法改进深度学习极限学习机实现数据预测附matlab代码_深度学习_08](https://s2.51cto.com/images/202205/83c6f4d554f03a4db41084b5a61be7ebce1d6b.gif)
![【DELM预测】基于探路者算法改进深度学习极限学习机实现数据预测附matlab代码_神经网络_10](https://s2.51cto.com/images/202205/e8254dd19942ee473c3534cc9e50c7b68780e4.gif)
2 部分代码
%___________________________________________________________________________%
% Pathfinder Algorithm (PFA) source codes version for desing problems %
% %
% Developed in MATLAB R2016b %
% %
% Author and developer: Hamza YAPICI %
% %
% hyapici@erbakan.edu.tr %
% This is a simple codes of PFA inspired by %
% collective movements and leadership behaviours %
% of animals. % %
% paper: Yapici H, Cetinkaya N. %
% A new meta-heuristic optimizer: %
% Pathfinder algorithm. %
% Applied Soft Computing. 2019. %
%___________________________________________________________________________%
% clear all
% clc
% format long;
% ObjectiveFunction = @Obj_function3; % Objective Function: Obj_function-Welded Beam Design,
% Obj_function2-Tension/Compression, Obj_function3-pressure vessel,
% Obj_function4-cantilever beam design
% initialization
% = 300;
% problem_size = 4;
% N = pop_size;
% dim = problem_size;
% max_iter = 500;
function [global_pop,fit_global, minc]=PFA(N ,dim ,max_iter,lb,ub,ObjectiveFunction)
% pressure vessel
Lb=lb*ones(1,dim);
Ub=ub*ones(1,dim);
problem_size=dim;
pop_size=N;
% Welded beam
% Lb=[.1 .1 .1 .1];
% Ub=[2 10 10 2];
% cantilever beam
% Lb=[0 0 0 0 0];
% Ub=[100 100 100 100 100];
% Tension/Compression
% Lb=[.05 .25 2];
% Ub=[2 1.3 15];
% first population
for j=1:problem_size
pop(:,j)=Lb(j)+(Ub(j)-Lb(j)).*rand(pop_size,1);
end
% calculate the fitness of first population
for ik=1:pop_size
pop_fitness(ik)=ObjectiveFunction(pop(ik,:));
end
% find pathfinder
fitness=pop_fitness;
[fit_global, index]=min(pop_fitness);
pop_old=pop;
global_pop=pop(index,:); path_p=global_pop;
path_old=path_p;
ub=Ub; lb=Lb;
minc(1)=fit_global;
meanc(1)=mean(pop_fitness);
iter=1;
% iterative loop
while iter < max_iter
iter = iter+1;
% parameters of PFA
u1=-1+(1-(-1)).*rand(N,1);
u2=-1+(1-(-1)).*rand(1,dim);
r3=rand(1,dim);
eps=(1 - iter/(max_iter)).*u1;
A=u2.*exp(-2.*iter/max_iter);
% update pathfinder
path_p(1,:) = path_p(1,:) + ...
((2).*r3(1,:)).*(path_old(1,:) - path_p(1,:)) + 1.*A(1,:);
Flag4ub=path_p(1,:)>ub(1,:); % check bounds % check lower bound for pathfinder
Flag4lb=path_p(1,:)<lb(1,:); % check upper bound for pathfinder
path_p(1,:)=(path_p(1,:).*(~(Flag4ub+Flag4lb)))+ub.*Flag4ub+lb.*Flag4lb;
% for j=1:problem_size
% if path_p(1,j)<Lb(j)
% path_p(1,j)=Lb(j);
% end
% if path_p(1,j)>Ub(j)
% path_p(1,j)=Ub(j);
% end
% end
path_old=path_p;
path_fitness=ObjectiveFunction(path_p(1,:));
[fitness, index] = sort(fitness);
pop=pop(index,:);
if path_fitness<fitness(1) % compare new fitness with old
fitness(1)=path_fitness;
pop(1,:)=path_p(1,:);
else
fitness(1)=fitness(1);
pop(1,:)=pop(1,:);
end
% update follower members
for ii=2:pop_size
% d=sqrt(abs(((pop(ii,:)).^2 - (pop(ii-1,:)).^2)));
d=sqrt(sum(((pop(ii,:)) - (pop(ii-1,:))).^2)); % calculate D(i,j)
alpha=1+rand(1,dim); % assign alpha
beta=1+rand(1,dim); % and beta
pop(ii,:) = pop(ii,:) ...
+ ((alpha(1,:)).*rand).*(global_pop(1,:) - pop(ii,:)) ...
+ ((beta(1,:)).*rand).*(pop_old(ii-1,:) - pop(ii,:)) + 1.*(eps(ii,1).*d); % update position of followers
Flag4ub=pop(ii,:)>ub(1,:);
Flag4lb=pop(ii,:)<lb(1,:);
pop(ii,:)=(pop(ii,:).*(~(Flag4ub+Flag4lb)))+ub.*Flag4ub+lb.*Flag4lb;
% for j=1:dim
%
% if pop(ii,j)<Lb(j)
% pop(ii,j)=Lb(j);
% end
% if pop(ii,j)>Ub(j)
% pop(ii,j)=Ub(j);
% end
% end
end
for i=1:pop_size
fitness(i)=ObjectiveFunction(pop(i,:)); % calculate new fitness of followers
if fitness(i) < pop_fitness(i) % update position via new fitness
pop_fitness(i) = fitness(i);
pop_old(i,:) = pop(i, :);
bsf_index = i;
else
pop_fitness(i) = pop_fitness(i);
pop_old(i,:) = pop_old(i, :);
end
end
% Find new pathfinder
[fit_global, index] = min(pop_fitness);
global_pop = pop_old(index,:);
path_p=global_pop;
minc(iter+1)=fit_global;
disp(['numevals:' num2str(iter) ...
' - best:' num2str(fit_global) ]);
end
% output variables
% x=global_pop;
% y=fit_global
% meanc=mean(minc)
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
- 45.
- 46.
- 47.
- 48.
- 49.
- 50.
- 51.
- 52.
- 53.
- 54.
- 55.
- 56.
- 57.
- 58.
- 59.
- 60.
- 61.
- 62.
- 63.
- 64.
- 65.
- 66.
- 67.
- 68.
- 69.
- 70.
- 71.
- 72.
- 73.
- 74.
- 75.
- 76.
- 77.
- 78.
- 79.
- 80.
- 81.
- 82.
- 83.
- 84.
- 85.
- 86.
- 87.
- 88.
- 89.
- 90.
- 91.
- 92.
- 93.
- 94.
- 95.
- 96.
- 97.
- 98.
- 99.
- 100.
- 101.
- 102.
- 103.
- 104.
- 105.
- 106.
- 107.
- 108.
- 109.
- 110.
- 111.
- 112.
- 113.
- 114.
- 115.
- 116.
- 117.
- 118.
- 119.
- 120.
- 121.
- 122.
- 123.
- 124.
- 125.
- 126.
- 127.
- 128.
- 129.
- 130.
- 131.
- 132.
- 133.
- 134.
- 135.
- 136.
- 137.
- 138.
- 139.
- 140.
3 仿真结果
![【DELM预测】基于探路者算法改进深度学习极限学习机实现数据预测附matlab代码_神经网络_12](https://s2.51cto.com/images/202205/c6c870008b6a2e787f21528e56467afd3252e9.gif)
编辑
4 参考文献
[1]马萌萌. 基于深度学习的极限学习机算法研究[D]. 中国海洋大学, 2016.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。