✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
的前馈神经网络算法,该方法随机产生隐含层与输入层之间的连接权值及隐含层神经元的阈值,训练过程中只需要设置隐含神经元的个数便可获得唯一最优解,极限学习机网络结构如图1所示。
% Sine wave prediction example with conventional extreme learning machine
close all, clear all
%% create datasets
train_feature=(15*rand(1,1000)-5)';
train_target=sin(train_feature);
train_data=[train_target, train_feature];
test_feature=(sort(15*rand(1,1000)-5))'; % the reason behind sorting is to see sine wave
test_target=sin(test_feature);
test_data=[test_target, test_feature];
%% train and test
neuron_number=20; activation_function='sig';
[~, ~, train_mse, test_mse, train_out, test_out]= ...
ELM(train_data, test_data, 0, neuron_number, activation_function);
%% Plot test data and see mean squared error
figure, plot(test_target, 'LineWidth',6), hold on, ...
plot(test_out, 'r-', 'LineWidth',1), legend('actual', 'output'),
title(['MSE=' num2str(test_mse) ''], 'FontSize', 12, 'FontWeight', 'bold'),
set(gca,'FontSize',12);
set(gcf,'color','w');
set(gcf,'PaperUnits','inches');
set(gcf,'PaperSize', [12 12]);
set(gcf,'PaperPosition',[0.5 0.5 7 7]);
set(gcf,'PaperPositionMode','Manual');
box off;
[1]胡庆国, 田学泽, 何忠明. 基于遗传算法优化极限学习机的绿色建筑投资估算方法[J]. 建筑经济, 2020.
❤️ 关注我领取海量matlab电子书和数学建模资料
❤️部分理论引用网络文献,若有侵权联系博主删除