当前位置:网站首页>【Matlab BP回归预测】GA优化BP回归预测(含优化前的对比)【含源码 1901期】
【Matlab BP回归预测】GA优化BP回归预测(含优化前的对比)【含源码 1901期】
2022-06-28 03:53:00 【Matlab佛怒唐莲】
一、代码运行视频(哔哩哔哩)
【Matlab BP回归预测】GA优化BP回归预测(含优化前的对比)【含源码 1901期】
二、相关技术原理简介
1 BP神经网络原理
反向传播(Back Propagation,BP)神经网络于1986年由Rumelhart和McCelland领导的科学家小组提出,是一种按误差逆传播算法训练的多层前馈神经网络。BP神经网络能学习和存贮大量的输入与输出模式映射关系,无需事前揭示描述这种映射关系的数学方程。其学习规则是使用最速下降法,通过反向传播不断调整网络的权值和阈值,从而使网络的误差平方和达到最小。BP神经网络拓扑结构可分为3层,分别是输入层、隐藏层以及输出层。其中,隐藏层的神经元个数计算公式为:
式中:m为输入层节点的个数,n为输出层节点的个数,a一般取1~10内的整数。隐藏层的个数越多,误差范围越小。
2 遗传优化算法
遗传算法是模拟达尔文生物进化论中自然选择和遗传学机理等生物进化过程的计算模型,是一种通过模拟自然进化过程搜索最优解的方法。依据BP神经网络的拓扑结构,确定优化BP神经网络权值阈值的参数个数,从而确定遗传算法中个体的编码长度,再根据适应度函数计算个体的适应值,经过选择、交叉、变异操作得到最优的权值阈值。
2.1 轮盘赌算法
轮盘赌算法是为了防止适应度数值较小群体中的个体被直接淘汰而提出的,每一个个体被选中的概率与其适应度函数值大小成正比关系。适应度数值越高,它被选中的概率就越大。设某一个体xi的适应度值为f(xi),则部分被选中的概率为:
累计概率为:
式中:xi和xj都表示某个个体。
首先,计算每个部分的被选中概率p(xi)和累积概率q(xi)。其次,随机生成一个数组m,数组m中的元素取值范围为[0,1]。若累积概率q(xi)大于数组中的元素m[i],则个体xi被选中;若小于m[i],则比较下一个个体xi+1,直至选出一个个体为止。最后,若需要选择N个个体,则将上述步骤重复N次即可。
2.2 两点交叉算法
两点交叉是指在个体染色体中随机设置两个交叉点,然后进行部分基因交换。先从编码串中不定向选出两个交叉点,再对两个交叉点进行部分染色体交叉,交叉后产生新个体,如图1所示。其中,左侧为交叉前的个体,右侧为两点交叉后产生的新个体。
图1 两点交叉示例
2.3 高斯变异
高斯变异是指进行变异操作时,用符合均值为μ、方差为S2的正态分布的一个随机数替代原有的基因值。根据正态分布的特性,高斯变异重点搜索原个体附近的某个局部区域。高斯概率密度公式为:
其中,标准高斯概率密度的μ和S分别设置为0和1。高斯变异不仅提高了优化算法的优化精度,而且有利于跳出局部最优区域。
三、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1]张三妞.基于遗传算法优化BP神经网络的电信客户流失预测研究[J].电视技术. 2022,46(05)
边栏推荐
- Introduction notes to machine learning
- 利用ELK 搭建日志分析系统(二)—— 部署安装
- Design a stack with getmin function
- 内卷、躺平与中年危机的相关思考
- 2022年中国音频市场年度综合分析
- 揭开SSL的神秘面纱,了解如何用SSL保护数据
- The coming wave of Web3
- Tiktok actual battle ~ take off the blogger
- What is the process of en 1101 flammability test for curtains?
- Reading notes of top performance version 2 (II) -- CPU monitoring
猜你喜欢

first. Net core MVC project

Multithreading and high concurrency IV: varhandle, strong weak virtual reference and ThreadLocal

leetcode - 329. Longest increasing path in matrix

Uncover the mystery of SSL and learn how to protect data with SSL

一文详解|增长那些事儿

【Matlab红绿灯识别】红绿灯识别【含GUI源码 1908期】

Digital promising, easy to reach, Huawei accelerates the layout of the commercial market with "five pole" star products
![leetcode:714. The best time to buy and sell stocks includes handling fee [DP dual status]](/img/e4/5ec39aced223512b162020d05eb313.png)
leetcode:714. The best time to buy and sell stocks includes handling fee [DP dual status]

Go language -select statement

How to traverse collections Ordereddict, taking it and forgetting items
随机推荐
基于正点原子stm32的mini板的TFTLCD显示实验
filinCdc 的sql,多表的时候总报这个错,请问下该怎么解决呀
Multithreading and high concurrency V: detailed explanation of wait queue, executor and thread pool (key)
Live online source code, JS dynamic effect, sidebar scrolling fixed effect
Une seule pile dans l'ordre inverse avec des fonctions récursives et des opérations de pile
What is the level 3 password complexity of ISO? How often is it replaced?
公司领导说,个人代码超10个Bug就开除,是什么体验?
2022年中國音頻市場年度綜合分析
Multithreading and high concurrency six: source code analysis of thread pool
La norme européenne en 597 - 1 pour les meubles est - elle la même que les deux normes en 597 - 2 pour les ignifuges?
Multithreading and high concurrency IV: varhandle, strong weak virtual reference and ThreadLocal
Web3来临时的风口浪尖
Why are cloud vendors targeting this KPI?
设计一个有getMin功能的栈
关于 SY8120I 的DC-DC的降压芯片的学习(12V降至3.3V)
Database garbled
After launching the MES system, these changes have taken place in the enterprise
Is it true that qiniu business school gives away securities accounts? Is it safe to open an account
01 overview, application scenarios, Download methods, connection methods and development history of mongodb
【MySQL】多表连接查询