启发式算法优化CNN网络结构之遗传算法

本文介绍使用遗传算法和模拟退火算法优化卷积神经网络(CNN)结构的方法,并提供了学习资源,包括视频教程和配套动画演示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近在做项目过程中,需要用到遗传算法、模拟退火算法等启发式算法对CNN网络结构优化,特此记录。

参考链接:https://www.codeleading.com/article/16952840392/

1、遗传算法学习

  • 1.1 下面这个讲解挺有趣的,推荐一波,还有配套的动画演示。

B站讲解
github动画
在这里插入图片描述

  • 1.2 莫凡Python系列

课程网站
可以很快了解编程的思路,然后就可以根据自己的想法和需求进行遗传算法的编程了。
在这里插入图片描述

2、遗传算法优化CNN结构实现

Genetic Algorithm Developed By : Prof. Kalyanmoy Deb with assistance from his Students. This is a GA implementation using binary and real coded variables. Mixed variables can be used. Constraints can also be handled. All constraints must be greater-than-equal-to type (g >= 0) and normalized (see the sample problem in prob1 in objective()). There are three sample input file (inp-r for real-coded variables only, inp-b for binary-coded variables only, and inp-rb for a mixed real and binary variables) which can be used to run this code. The template file for each input data file is also included (input-real, input-binary, and input-real+binary). Code your objective function and constraints at the end of the code (in objective()) Variable boundaries for real-coded variables can be fixed or flexible. Following selection opeartor is coded: Tournament selection: Set MINM=1 for minimization and -1 for maximization in objective(). For binary strings, single-point crossover and for real parameters simulated binary crossover (SBX) are used. Mutation: bit-wise for Binary coded GAs and polynomial mutation (with eta) for Real coded GAs Constraints are handled using Deb's paramater-less approach (see CMAME, 2000 paper) Niching allows restricted tournament selection. Recommended for complex and disconnected feasible regions. (Niching parameter of 0.1 is recommended.) The execution creates a file `result.out' which contains the input data and best solution obtained by the GA. The feasiblilty of the best solution and constraint values are also marked. The report.out contains population record of each generation. The file 'plot.out' contains a gnuplot-compatibale data file for plotting best, avg, and worst population fitness versus generation number.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Ray Song

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

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

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

打赏作者

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

抵扣说明:

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

余额充值