粒子群优化粒子群改进算法

粒子群优化(PSO)是一种基于自然群集行为的启发式优化方法。本文介绍了一种改进版的PSO,通过遗传算法优化参数,提高了其在标准测试函数上的性能。此改进的PSO在机器学习领域具有潜在优势。
摘要由CSDN通过智能技术生成

Particle Swarm Optimization (PSO) is one of the heuristic optimization methods that use swarming rules of the birds/insects that we see in nature. The main idea is to follow the leading member/leading group of particles of the swarm who are close to the goal (most probably the food) of the team. I will not give detailed information about PSO here, anyone can find enough info in the open literature among very great studies, some of which are given in the references in the end of this post. One only thing that I should add is, the PSO that is given here is an improved one that has added parameters with some coefficients which have been found with Genetic Algorithm. This version given here outperforms the standard PSO almost at all of the universal test functions given here. Some detailed information is given in the upcoming sections.

粒子群优化(PSO)是一种启发式优化方法之一,它使用了我们在自然界中看到的鸟类/昆虫的群聚规则。 主要思想是跟随团队成员接近团队目标(最可能是食物)的领导成员/领导小组。 我不会在此处提供有关PSO的详细信息,任何人都可以在非常出色的研究中的公开文献中找到足够的信息,其中一些在本文结尾的参考文献中给出。 我要添加的唯一一件事是,此处给出的PSO是一种改进的PSO,它添加了一些参数,这些参数具有一些在遗传算法中发现的系数。 此处给出的该版本几乎在此处给出的所有通用测试功能上均优于标准PSO。 在接下来的部分中将提供一些详细信息。

The very first thing to do is to import necessary modules to our python environment. The pygame module is used for visualization of what is happening through the iterations. It can be taken to “off” if not necessary.

首先要做的是将必要的模块导入到我们的python环境中。 pygame模块用于可视化迭代中发生的事情。 如有必要,可以将其设为“关闭”。

Image for post
Import Necessary Modules, at first
首先导入必要的模块

群群 (Swarm Class)

The swarm class given below consists of sub-routines what is needed for PSO.

下面给出的swarm类由PSO所需的子例程组成。

The init function is the main body of our class where we define the basic features of the swarming particle objects. We input the function that is going to be optimized, as well as the lower and upper bounds that are obligatory. Some (“egg” and “griewank”) of the universal test functions defined in the “Universal Test Functions” section given after, are predefined inside the init function with their lower and upper boundaries, however, in real world cases, these arguments should be input with the function itself by the user.

初始化函数是我们班级的主体,在这里我们定义了群集粒子对象的基本特征。 我们输入将要优化的功能,以及必填的上下限。 在下文给出的“通用测试功能”部分中定义的某些通用测试功能(“蛋”和“格里高克”)是在init函数内部预先定义的,具有上下限,但是,在实际情况下,这些参数应由用户自己输入功能。

The pygame screen where the user can visualize what is happening inside the swarm is in the “off” mode by default but can be made “on” by making the “display” argument “True”.

pygame屏幕上,用户可以看到群体内部发生的事情,默认情况下处于“关闭”模式,但可以通过将“显示”参数设置为“真”来将其设为“打开”。

The migration is inherently “on” if nothing is done but can be closed by changing the “migrationexists” argument to “False”. The migration probability is set to 0.15 by default and can be changed if necessary. The default nu

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值