【FNN预测】基于蝙蝠优化的模糊神经网络FNN研究附Matlab代码

简介: 【FNN预测】基于蝙蝠优化的模糊神经网络FNN研究附Matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信      无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机

⛄ 内容介绍

耙吸挖泥船的耙头产量主要取决于耙头的吸入密度,准确的吸入密度预测对提高耙吸挖泥船疏浚产量具有重要的意义.针对目前对吸入密度预测方法存在精度低,实时效果性差的缺点,提出了一种蝙蝠算法与模糊神经网络相结合的预测方法.通过实测施工数据,构建BA-FNN预测模型.实验表明:BA-FNN预测精度高且稳定性能好,能够为耙头产量预测以及指导施工提供科学有效的参考依据.

⛄ 部分代码

% ======================================================== %

% Files of the Matlab programs included in the book:       %

% Xin-She Yang, Nature-Inspired Metaheuristic Algorithms,  %

% Second Edition, Luniver Press, (2010).   www.luniver.com %

% ======================================================== %    


% -------------------------------------------------------- %

% Bat-inspired algorithm for continuous optimization (demo)%

% Programmed by Xin-She Yang @Cambridge University 2010    %

% -------------------------------------------------------- %

% Usage: bat_algorithm([20 1000 0.5 0.5]);                 %



% -------------------------------------------------------------------

% This is a simple demo version only implemented the basic          %

% idea of the bat algorithm without fine-tuning(微调)the parameters,     %

% Then, though this demo works very well, it is expected that       %

% this demo is much less efficient than the work reported in        %

% the following papers:                                             %

% (Citation details):                                               %

% 1) Yang X.-S., A new metaheuristic bat-inspired algorithm,        %

%    in: Nature Inspired Cooperative Strategies for Optimization    %

%    (NISCO 2010) (Eds. J. R. Gonzalez et al.), Studies in          %

%    Computational Intelligence, Springer, vol. 284, 65-74 (2010).  %

% 2) Yang X.-S., Nature-Inspired Metaheuristic Algorithms,          %

%    Second Edition, Luniver Presss, Frome, UK. (2010).             %

% 3) Yang X.-S. and Gandomi A. H., Bat algorithm: A novel           %

%    approach for global engineering optimization,                  %

%    Engineering Computations, Vol. 29, No. 5, pp. 464-483 (2012).  %

% -------------------------------------------------------------------



% Main programs starts here

function [best,fmin,N_iter]=bat_algorithm(para)

% Display help

help bat_algorithm.m


% Default parameters 默认参数


if nargin<1,  para=[20 1000 0.5 0.5];  end

n=para(1);      % Population size, typically10 to 40

N_gen=para(2);  % Number of generations

A=para(3);      % Loudness  (constant or decreasing)

r=para(4);      % Pulse rate (constant or decreasing)

% This frequency range determines the scalings

% You should change these values if necessary

Qmin=0;         % Frequency minimum

Qmax=2;         % Frequency maximum

% Iteration parameters

N_iter=0;       % Total number of function evaluations  %这是什么意思???

% Dimension of the search variables

d=10;           % Number of dimensions

% Lower limit/bounds/ a vector

Lb=-2*ones(1,d);

% Upper limit/bounds/ a vector

Ub=2*ones(1,d);  

% Initializing arrays

Q=zeros(n,1);   % Frequency

v=zeros(n,d);   % Velocities

% Initialize the population/solutions

for i=1:n,

 Sol(i,:)=Lb+(Ub-Lb).*rand(1,d);

 Fitness(i)=Fun(Sol(i,:));

end

% Find the initial best solution

[fmin,I]=min(Fitness);   %返回多个参数的时候用[ ],fmin接受第一个参数,I接受第二个参数

%这里fmin是最小值,I是最小值的索引,也就是第几个

best=Sol(I,:);


% ======================================================  %

% Note: As this is a demo, here we did not implement the  %

% reduction of loudness and increase of emission rates.   %

% Interested readers can do some parametric studies       %

% and also implementation various changes of A and r etc  %

% ======================================================  %


% Start the iterations -- Bat Algorithm (essential part)  %

for t=1:N_gen,

% Loop over all bats/solutions

       for i=1:n,

         Q(i)=Qmin+(Qmin-Qmax)*rand;%其中rand产生一个0到1的随机数

         v(i,:)=v(i,:)+(Sol(i,:)-best)*Q(i);

         S(i,:)=Sol(i,:)+v(i,:);

         % Apply simple bounds/limits

         Sol(i,:)=simplebounds(Sol(i,:),Lb,Ub);

         % Pulse rate

         if rand>r

         % The factor 0.001 limits the step sizes of random walks

             S(i,:)=best+0.001*randn(1,d);

         end


    % Evaluate new solutions

          Fnew=Fun(S(i,:));

    % Update if the solution improves, or not too loud

          if (Fnew<=Fitness(i)) & (rand<A) ,

               Sol(i,:)=S(i,:);

               Fitness(i)=Fnew;

          end


         % Update the current best solution

         if Fnew<=fmin,

               best=S(i,:);

               fmin=Fnew;

         end

       end

       N_iter=N_iter+n;

       

end

% Output/display

disp(['Number of evaluations: ',num2str(N_iter)]);

disp(['Best =',num2str(best),' fmin=',num2str(fmin)]);


% Application of simple limits/bounds

function s=simplebounds(s,Lb,Ub)

 % Apply the lower bound vector

 ns_tmp=s;

 I=ns_tmp<Lb;

 ns_tmp(I)=Lb(I);

 

 % Apply the upper bound vector

 J=ns_tmp>Ub;

 ns_tmp(J)=Ub(J);

 % Update this new move

 s=ns_tmp;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Objective function: your own objective function can be written here

% Note: When you use your own function, please remember to

%       change limits/bounds Lb and Ub (see lines 52 to 55)

%       and the number of dimension d (see line 51).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function z=Fun(u)

% Sphere function with fmin=0 at (0,0,...,0)

z=sum(u.^2);

%%%%% ============ end ====================================



⛄ 运行结果

⛄ 参考文献

[1]张容, 阎红, 杜丽萍. 基于模糊神经网络(FNN)的赤潮预警预测研究[J]. 海洋通报:英文版, 2006, 25(001):83-91.

[2]赵建强, 陈必科, 葛考, et al. 基于FOA—FNN算法的边坡稳定性评价研究[C]// 中国系统工程学会第十八届学术年会. 2014.

[3]郝光杰, 俞孟蕻, and 苏贞. "基于蝙蝠算法优化模糊神经网络的耙吸挖泥船耙头吸入密度研究." 计算机与数字工程 002(2022):050.

⛳️ 完整代码

❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料


相关实践学习
部署高可用架构
本场景主要介绍如何使用云服务器ECS、负载均衡SLB、云数据库RDS和数据传输服务产品来部署多可用区高可用架构。
负载均衡入门与产品使用指南
负载均衡(Server Load Balancer)是对多台云服务器进行流量分发的负载均衡服务,可以通过流量分发扩展应用系统对外的服务能力,通过消除单点故障提升应用系统的可用性。 本课程主要介绍负载均衡的相关技术以及阿里云负载均衡产品的使用方法。
相关文章
|
5天前
|
机器学习/深度学习 自然语言处理 数据可视化
数据代码分享|PYTHON用NLP自然语言处理LSTM神经网络TWITTER推特灾难文本数据、词云可视化
数据代码分享|PYTHON用NLP自然语言处理LSTM神经网络TWITTER推特灾难文本数据、词云可视化
18 1
|
20小时前
|
传感器 数据采集 数据处理
MATLAB热传导方程模型最小二乘法模型、线性规划对集成电路板炉温优化
MATLAB热传导方程模型最小二乘法模型、线性规划对集成电路板炉温优化
|
2天前
|
机器学习/深度学习 算法 数据挖掘
基于PSO优化的CNN-GRU-Attention的时间序列回归预测matlab仿真
摘要: 本文介绍了运用粒子群优化(PSO)调整深度学习模型超参数以提升时间序列预测性能的方法。在比较了优化前后的效果(Ttttttttttt12 vs Ttttttttttt34)后,阐述了使用matlab2022a软件的算法。文章详细讨论了CNN、GRU网络和注意力机制在时间序列预测中的作用,以及PSO如何优化这些模型的超参数。核心程序展示了PSO的迭代过程,通过限制和调整粒子的位置(x1)和速度(v1),寻找最佳解决方案(gbest1)。最终,结果保存在R2.mat文件中。
基于PSO优化的CNN-GRU-Attention的时间序列回归预测matlab仿真
|
2天前
|
数据可视化 算法 数据挖掘
R语言SIR模型网络结构扩散过程模拟SIR模型(Susceptible Infected Recovered )代码实例
R语言SIR模型网络结构扩散过程模拟SIR模型(Susceptible Infected Recovered )代码实例
10 0
|
2天前
|
机器学习/深度学习 算法 数据可视化
MATLAB基于深度学习U-net神经网络模型的能谱CT的基物质分解技术研究
MATLAB基于深度学习U-net神经网络模型的能谱CT的基物质分解技术研究
|
4天前
|
机器学习/深度学习 PyTorch TensorFlow
TensorFlow、Keras 和 Python 构建神经网络分析鸢尾花iris数据集|代码数据分享
TensorFlow、Keras 和 Python 构建神经网络分析鸢尾花iris数据集|代码数据分享
15 0
|
5天前
|
传感器 存储 监控
编写Arduino代码:构建物联网设备,实现上网行为管理软件对网络的实时监控
使用Arduino和ESP8266/ESP32等Wi-Fi模块,结合传感器监控网络活动,本文展示了如何编写代码实现实时监控并自动将数据提交至网站。示例代码展示如何连接Wi-Fi并检测网络状态,当连接成功时,通过HTTP POST请求将“Network activity detected.”发送到服务器。通过调整POST请求的目标URL和数据,可将监控数据上传至所需网站进行处理和存储。
28 0
|
5天前
|
机器学习/深度学习 算法 计算机视觉
m基于Yolov2深度学习网络的人体喝水行为视频检测系统matlab仿真,带GUI界面
MATLAB 2022a中使用YOLOv2算法对avi视频进行人体喝水行为检测,结果显示成功检测到目标。该算法基于全卷积网络,通过特征提取、锚框和损失函数优化实现。程序首先打乱并分割数据集,利用预训练的ResNet-50和YOLOv2网络结构进行训练,最后保存模型。
17 5
|
6天前
|
机器学习/深度学习 数据可视化 网络架构
Matlab用深度学习循环神经网络RNN长短期记忆LSTM进行波形时间序列数据预测
Matlab用深度学习循环神经网络RNN长短期记忆LSTM进行波形时间序列数据预测
22 8
|
3月前
|
机器学习/深度学习 算法 PyTorch
python手把手搭建图像多分类神经网络-代码教程(手动搭建残差网络、mobileNET)
python手把手搭建图像多分类神经网络-代码教程(手动搭建残差网络、mobileNET)
46 0