✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
由 PSO 训练的完全连接的常规自动编码器
⛄ 部分代码
clear all;
clc;
addpath('NEW_PSO','AE');
%% data preparation
original=imread('me_and_my_son.jpg');
original=imresize(original,[150,90]);
x=rgb2gray(original);
Inputs=double(x);
%% network initialization
number_neurons=89;% number of neurons
LB=-10; % lower bands of weights
UB=10; % upperbands of weights
n=10; % number of population
%% training process
[net]=PSO_AE(Inputs,number_neurons,LB,UB,n);
%% Illustration
regenerated=net.code*pinv(net.B');
subplot(121)
imagesc(regenerated);
colormap(gray);
Tc=num2str(net.prefomance);
Tc= ['RMSE = ' Tc];
xlabel('regenerated image')
title(Tc)
subplot(122)
plot(smooth(net.errors,52),'LineWidth',2);
xlabel('iterations')
ylabel('RMSE')
title('loss function behavior')
axis([0 length(net.errors) min(net.errors) max(net.errors)])
grid
⛄ 运行结果
⛄ 参考文献
[1] M. N. Alam, “Particle Swarm Optimization : Algorithm and its Codes in MATLAB Particle Swarm Optimization : Algorithm and its Codes in MATLAB,” no. March, 2016.
[2] Y. Liu, B. He, D. Dong, Y. Shen, and T. Yan, “ROS-ELM: A Robust Online Sequential Extreme Learning Machine for Big Data Analytics,” Proc. ELM-2014 Vol. 1, Algorthims Theor., vol. 3, pp. 325–344, 2015.
[3] H. Zhou, G.-B. Huang, Z. Lin, H. Wang, and Y. C. Soh, “Stacked Extreme Learning Machines.,” IEEE Trans. Cybern., vol. PP, no. 99, p. 1, 2014.