【BP预测】基于Tent混沌映射原子搜索算法优化BP神经网络实现数据回归预测附matlab代码

本文探讨了如何使用混沌映射原子搜索算法(ASO)改进传统BP神经网络的初始化权重和阈值,以解决其陷入局部最小值和收敛速度慢的问题。ASO算法受到分子动力学的启发,模拟原子系统的相互作用和运动状态。通过MATLAB实现的代码展示了ASO如何应用于神经网络优化,并提供了仿真实验结果来验证其有效性。

 1 简介

BP神经网络算法使用非常广泛,传统的BP神经网络算法虽然具有不错的拟合非线性函数的能力,但是容易陷入局部的极小值,并且传统的算法收敛的速度慢.本篇文章详细地论述了如何使用ent混沌映射原子搜索算法算法优化传统的BP神经网络算法中初始的权值和阀值,通过相应的验证和比较提出了该模型的有效性.

作为物理-元启发式算法中的一种,ASO 最早在 2018 年由赵卫国提出并将其应用于地下水分散系数估计。ASO 的灵感来自于基本的分子动力学,自然界中所有的物质都是由原子组成,原子具备质量和体积,在一个原子系统中,所有原子都是相互作用并且处于恒定的运动状态,其微观相互作用十分复杂。随着科学技术的发展,近些年来分子动力学发展迅速,已经可以使用计算机模拟原子和分子的物理运动规律。

正在上传…重新上传取消

正在上传…重新上传取消

​2 部分代码

%--------------------------------------------------------------------------% GSA code v1.0.% Developed in MATLAB R2011b% The code is based on the following papers.% W. Zhao, L. Wang and Z. Zhang, Atom search optimization and its % application to solve a hydrogeologic parameter estimation problem, % Knowledge-Based Systems (2018), https://doi.org/10.1016/j.knosys.2018.08.030.%% W. Zhao, L. Wang and Z. Zhang, A novel atom search optimization for % dispersion coefficient estimation in groundwater, Future Generation % Computer Systems (2018), https://doi.org/10.1016/j.future.2018.05.037.%--------------------------------------------------------------------------% Atom Search Optimization.function [X_Best,Fit_XBest,Functon_Best]=ASO(alpha,beta,Fun_Index,Atom_Num,Max_Iteration)% Dim: Dimension of search space.% Atom_Pop: Population (position) of atoms.% Atom_V:  Velocity of atoms.% Acc: Acceleration of atoms.% M: Mass of atoms. % Atom_Num: Number of atom population.% Fitness: Fitness of atoms.% Max_Iteration: Maximum of iterations.% X_Best: Best solution (position) found so far. % Fit_XBest: Best result corresponding to X_Best. % Functon_Best: The fitness over iterations. % Low: The low bound of search space.% Up: The up bound of search space.% alpha: Depth weight.% beta: Multiplier weightalpha=50;beta=0.2;   Iteration=1;   [Low,Up,Dim]=Test_Functions_Range(Fun_Index);     % Randomly initialize positions and velocities of atoms.     if size(Up,2)==1         Atom_Pop=rand(Atom_Num,Dim).*(Up-Low)+Low;         Atom_V=rand(Atom_Num,Dim).*(Up-Low)+Low;     end        if size(Up,2)>1        for i=1:Dim           Atom_Pop(:,i)=rand(Atom_Num,1).*(Up(i)-Low(i))+Low(i);           Atom_V(:,i)=rand(Atom_Num,1).*(Up(i)-Low(i))+Low(i);        end     end % Compute function fitness of atoms.     for i=1:Atom_Num       Fitness(i)=Test_Functions(Atom_Pop(i,:),Fun_Index,Dim);     end       Functon_Best=zeros(Max_Iteration,1);       [Max_Fitness,Index]=min(Fitness);       Functon_Best(1)=Fitness(Index);       X_Best=Atom_Pop(Index,:);      % Calculate acceleration. Atom_Acc=Acceleration(Atom_Pop,Fitness,Iteration,Max_Iteration,Dim,Atom_Num,X_Best,alpha,beta); % Iteration for Iteration=2:Max_Iteration            Functon_Best(Iteration)=Functon_Best(Iteration-1);           Atom_V=rand(Atom_Num,Dim).*Atom_V+Atom_Acc;           Atom_Pop=Atom_Pop+Atom_V;                      for i=1:Atom_Num       % Relocate atom out of range.             TU= Atom_Pop(i,:)>Up;           TL= Atom_Pop(i,:)<Low;           Atom_Pop(i,:)=(Atom_Pop(i,:).*(~(TU+TL)))+((rand(1,Dim).*(Up-Low)+Low).*(TU+TL));           %evaluate atom.            Fitness(i)=Test_Functions(Atom_Pop(i,:),Fun_Index,Dim);         end        [Max_Fitness,Index]=min(Fitness);                   if Max_Fitness<Functon_Best(Iteration)             Functon_Best(Iteration)=Max_Fitness;             X_Best=Atom_Pop(Index,:);          else            r=fix(rand*Atom_Num)+1;             Atom_Pop(r,:)=X_Best;        end           % Calculate acceleration.       Atom_Acc=Acceleration(Atom_Pop,Fitness,Iteration,Max_Iteration,Dim,Atom_Num,X_Best,alpha,beta); endFit_XBest=Functon_Best(Iteration); 

3 仿真结果

4 参考文献

[1]马俊涛. 基于MATLAB的BP神经网络模型的预测算法研究[C]// 军事信息软件与仿真学术研讨会. 中国电子学会, 2006.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值