Differential Evolution: A Survey of the State-of-the-Art
@
@article{das2011differential,
title={Differential Evolution: A Survey of the State-of-the-Art},
author={Das, Swagatam and Suganthan, P N},
journal={IEEE Transactions on Evolutionary Computation},
volume={15},
number={1},
pages={4--31},
year={2011}}
概
这是一篇关于Differential Evolution (DE) 的综述, 由于对这类方法并不熟悉, 只能简单地做个记录.
主要内容
考虑如下问题,
\]
其中\(X=(x_1,\ldots,x_D)\).
我所知的, 如梯度下降方法, 贝叶斯优化可以用来处理这类问题, 但是还有诸如 evolutionary algorithm (EA), evolutionary programming (EP), evolution strategies(ESs), genetic algorithm (GA), 以及本文介绍的 DE (后面的基本都不了解).
DE/rand/1/bin
先给出最初的形式, 称之为DE/rand/1/bin:
Input: scale factor \(F\), crossover rate \(Cr\), population size \(NP\).
1: 令\(G=0\), 并随机初始化\(P_G=\{ X_{1,G},\ldots, X_{NP,G}\}\).
2: While the stopping criterion is not satisfied Do:
- For \(i=1,\ldots, NP\) do:
- Mutation step:
\]
- Crossover step: 按照如下方式生成\(U_{i,G}=(u_{1,i,G},\ldots, u_{D,i,G})\)
\left \{ \begin{array}{ll}
v_{j,i,G} & if \: \mathrm{rand}[0,1] \le Cr \: or \: j=j_{rand} \\
x_{j,i,G} & otherwise.
\end{array} \right.
\]
- Selection step:
\left \{ \begin{array}{ll}
U_{i,G} & if \: f(U_{i,G}) \le f(X_{i,G}) \\
X_{i,G} & otherwise.
\end{array} \right.
\]
- End For.
- \(G=G+1\).
End While.
其中\(X_{i,G}=(x_{j,i,G}, \ldots, x_{D,i,G})\), \(j_{rand}\)是预先随机生成的一个属于\([1,D]\)的整数, 以保证\(U\)相对于\(X\)至少有些许变化产生, \(X_{r_1^i,G}, X_{r_2^i,G},X_{r_3^i,G}\)是从\(P_G\)中随机抽取且互异的.
在接下来我们可以发现很多变种, 而这些变种往往是Mutation step 和 Crossover step的变体.
DE/?/?/?
DE/rand/1/exp
这是crossover step步的的一个变种:
随机从\([1, D]\)中抽取整数\(n\)和\(L\), 然后
\left \{ \begin{array}{ll}
v_{j,i,G} & if \: n \le j \le n+L-1\\
x_{j,i,G} & otherwise.
\end{array} \right.
\]
\(L\)可以通过下面的步骤生成
- \(L=0\)
- while \(\mathrm{rand}[0,1] \le Cr\) and \(L\le D\):
\]
DE/best/1
\]
其中\(X_{best,G}\)是\(P_{G}\)中的最优的点.
DE/best/2
\]
DE/rand/2
\]
超参数的选择
真的没有细看, 文中粗略地介绍了几处, 还有很多需要查原文.
\(F\)的选择
有的推荐\([0.4, 1]\)(最佳0.5), 有的推荐\(0.6\), 有的推荐\([0.4, 0.95]\)(最佳0.9).
还有一些自适应的选择, 如
\left \{ \begin{array}{ll}
\max \{l_{\min}, 1- |\frac{f_{\max}}{f_{\min}}|\} & if : |\frac{f_{\max}}{f_{\min}}|<1 \\
\max \{l_{\min}, 1- |\frac{f_{\max}}{f_{\min}}|\} & otherwise,
\end{array} \right.
\]
我比较疑惑的是难道\(|\frac{f_{\max}}{f_{\min}}|\)不是大于等于1吗?
\left \{ \begin{array}{ll}
\mathrm{rand}[F_l, F_{u}] & with \: probability \:\tau \\
F_{i,G} & else,
\end{array} \right.
\]
其中\(F_l\), \(F_u\)分别为\(F\)取值的下界和上界.
\(NP\)的选择
有的推荐\([5D,10D]\), 有的推荐\([3D, 8D]\).
\(Cr\)的选择
有的推荐\([0.3, 0.9]\).
还有
\left \{ \begin{array}{ll}
\mathrm{rand}[0, 1] & with \: probability \:\tau \\
Cr_{i,G} & else,
\end{array} \right.
\]
一些连续变体
A
p_1 = f(X_{r_1})/p \\
p_2 = f(X_{r_2}) / p \\
p_3 = f(X_{r_1}) / p.
\]
如果\(\mathrm{rand}[0,1] < \Gamma\)(\(\Gamma\)是给定的):
V_{i,G+1} = & (X_{r_1}+X_{r_2}+X_{r_3})/3 +(p_2-p_1)(X_{r_1}-X_{r_2}) \\
&+ (p_3-p_2)(X_{r_2} - X_{r_3}) + (p_1-p_3) (X_{r_3}- X_{r_1}),
\end{array}
\]
否则
\]
B
\]
其中\(k_i\)给定, \(F'=k_i \cdot F\).
C

D
即在考虑\(x\)的时候, 还需要考虑其反\(a+b-x\), 假定\(x \in [a, b]\), \([a,b]\)为我们给定范围, \(X\)的反类似的构造.
E

其中\(X_{n_{best},G}\)表示在\(X_{i,G}\)的\(n\)的近邻中的最优点, \(p, q\in [i-k,i+k]\).

其中\(X_{g_{best},G}\)为\(P_G\)中的最优点.
\]
G

剩下的在复杂环境下的应用就不记录了(只是单纯讲了该怎么做).
一些缺点
- 高维问题不易处理;
- 容易被一些问题欺骗, 而现如局部最优解;
- 对不能分解的函数效果不是很好;
- 路径往往不会太大(即探索不充分);
- 缺少收敛性的理论的保证.
代码
\(f(x,y)=x^2+50y^2\).

{
"dim": 2,
"F": 0.5,
"NP": 5,
"Cr": 0.35
}
"""
de.py
"""
import numpy as np
from scipy import stats
import random
class Parameter:
def __init__(self, dim, xmin, xmax):
self.dim = dim
self.xmin = xmin
self.xmax = xmax
self.initial()
def initial(self):
self.para = stats.uniform.rvs(
self.xmin, self.xmax - self.xmin
)
@property
def data(self):
return self.para
def __getitem__(self, item):
return self.para[item]
def __setitem__(self, key, value):
self.para[key] = value
def __len__(self):
return len(self.para)
def __add__(self, other):
return self.para + other
def __mul__(self, other):
return self.para * other
def __pow__(self, power):
return self.para ** power
def __neg__(self):
return -self.para
def __sub__(self, other):
return self.para - other
def __truediv__(self, other):
return self.para / other
class DE:
def __init__(self, func, dim ,F=0.5, NP=50,
Cr=0.35, xmin=-10, xmax=10,
require_history=True):
self.func = func
self.dim = dim
self.F = F
self.NP = NP
self.Cr = Cr
self.xmin = np.array(xmin)
self.xmax = np.array(xmax)
assert all(self.xmin <= self.xmax), "Invalid xmin or xmax"
self.require_history = require_history
self.init_x()
if self.require_history:
self.build_history()
def init_x(self):
self.paras = [Parameter(self.dim, self.xmin, self.xmax)
for i in range(self.NP)]
@property
def data(self):
return [para.data for para in self.paras]
def build_history(self):
self.paras_history = [self.data]
def add_history(self):
self.paras_history.append(self.data)
def choose(self, size=3):
return random.sample(self.paras, k=size)
def mutation(self):
x1, x2, x3 = self.choose(3)
return x1 + self.F * (x2 - x3)
def crossover(self, v, x):
u = np.zeros_like(v)
for i, _ in enumerate(v):
jrand = random.randint(0, self.dim)
if np.random.rand() < self.Cr or i is jrand:
u[i] = v[i]
else:
u[i] = x[i]
u[i] = v[i] if np.random.rand() < self.Cr else x[i]
return u
def selection(self, u, x):
if self.func(u) < self.func(x):
x.para = u
else:
pass
def step(self):
donors = [self.mutation()
for i in range(self.NP)]
for i, donor in enumerate(donors):
x = self.paras[i]
u = self.crossover(donor, x)
self.selection(u, x)
if self.require_history:
self.add_history()
def multi_steps(self, times):
for i in range(times):
self.step()
class DEbest1(DE):
def bestone(self):
y = np.array([self.func(para)
for para in self.paras])
return self.paras[np.argmax(y)]
def mutation(self, bestone):
x1, x2 = self.choose(2)
return bestone + self.F * (x1 - x2)
def step(self):
bestone = self.bestone()
donors = [self.mutation(bestone)
for i in range(self.NP)]
for i, donor in enumerate(donors):
x = self.paras[i]
u = self.crossover(donor, x)
self.selection(u, x)
if self.require_history:
self.add_history()
class DEbest2(DEbest1):
def mutation(self, bestone):
x1, x2, x3, x4 = self.choose(4)
return bestone + self.F * (x1 - x2) \
+ self.F * (x3 - x4)
class DErand2(DE):
def mutation(self):
x1, x2, x3, x4, x5 = self.choose(5)
return x1 + self.F * (x2 - x3) \
+ self.F * (x4 - x5)
class DErandTM(DE):
def mutation(self):
x = self.choose(3)
y = np.array(list(map(self.func, x)))
p = y / y.sum()
part1 = (x[0] + x[1] + x[2]) / 3
part2 = (p[1] - p[0]) * (x[0] - x[1])
part3 = (p[2] - p[1]) * (x[2] - x[1])
part4 = (p[0] - p[2]) * (x[2] - x[0])
return part1 + part2 + part3 + part4
Differential Evolution: A Survey of the State-of-the-Art的更多相关文章
- SBX(Simulated binary crossover)模拟二进制交叉算子和DE(differential evolution)差分进化算子
一起来学演化计算-SBX(Simulated binary crossover)模拟二进制交叉算子和DE(differential evolution)差分进化算子 觉得有用的话,欢迎一起讨论相互学习 ...
- Image Processing and Analysis_8_Edge Detection:Edge and line oriented contour detection State of the art ——2011
此主要讨论图像处理与分析.虽然计算机视觉部分的有些内容比如特 征提取等也可以归结到图像分析中来,但鉴于它们与计算机视觉的紧密联系,以 及它们的出处,没有把它们纳入到图像处理与分析中来.同样,这里面也有 ...
- differential evolution代码实例(DE算法)
DE算法是遗传算法中一种比较流行的算法,这种算法比较简单,速度也比较快,下面给出一份示例代码 clear all; close all; clc 2 %Function to be minimized ...
- 翻新并行程序设计的认知整理版(state of the art parallel)
近几年,业内对并行和并发积累了丰富的经验.有了较深刻的理解.但之前积累的大量教材,在当今的软硬件体系下.反而都成了负面教材.所以,有必要加强宣传,翻新大家的认知. 首先.天地倒悬,结论先行:当你须要并 ...
- HyperLogLog in Practice: Algorithmic Engineering of a State of The Art Cardinality Estimation Algorithm
HyperLogLog参考下面这篇blog, http://blog.codinglabs.org/articles/algorithms-for-cardinality-estimation-par ...
- awesome-RecSys
https://github.com/jihoo-kim/awesome-RecSys?fbclid=IwAR1m6OebmqO9mfLV1ta4OTihQc9Phw8WNS4zdr5IeT1X1OL ...
- 差分进化算法 DE-Differential Evolution
差分进化算法 (Differential Evolution) Differential Evolution(DE)是由Storn等人于1995年提出的,和其它演化算法一样,DE是一种模拟生物进化 ...
- 论文学习-深度学习目标检测2014至201901综述-Deep Learning for Generic Object Detection A Survey
目录 写在前面 目标检测任务与挑战 目标检测方法汇总 基础子问题 基于DCNN的特征表示 主干网络(network backbone) Methods For Improving Object Rep ...
- 机器学习经典论文/survey合集
Active Learning Two Faces of Active Learning, Dasgupta, 2011 Active Learning Literature Survey, Sett ...
随机推荐
- day02 Linux基础
day02 Linux基础 1.什么是服务器 服务器,也称伺服器,是提供计算服务的设备.由于服务器需要响应服务请求,并进行处理,因 此一般来说服务器应具备承担服务并且保障服务的能力. windows: ...
- C语言把数字转换为字符串的函数
博主原文 C语言itoa()函数和atoi()函数详解(整数转字符C实现) C语言提供了几个标准库函数,可以将任意类型(整型.长整型.浮点型等)的数字转换为字符串. 1.int/float to st ...
- 分配器——allocators
任何容器的构建都离不开分配器,分配器顾名思义就是分割配置内存资源的组件,分配器的效率直接影响力容器的效率. operator new()和malloc() C/C++底层都是通过malloc()调用系 ...
- 颜色RGB值对照表
转载自 http://www.91dota.com/?p=49# 常用颜色的RGB值及中英文名称 颜 色 RGB值 英文名 中文名 #FFB6C1 LightPink 浅粉红 #F ...
- ViewStub应用
在开发应用程序的时候,会遇到这样的情况,在运行时动态的根据条件来决定显示哪个View或哪个布局,可以把可能用到的View都写在上面,先把他们的可见性设置为View.GONE,然后在代码中动态的更改它的 ...
- OpenStack之三: 安装MySQL,rabbitmq, memcached
官网地址:https://docs.openstack.org/install-guide/environment-sql-database-rdo.html #:安装mysql [root@mysq ...
- ICCV2021 | 用于视觉跟踪的学习时空型transformer
前言 本文介绍了一个端到端的用于视觉跟踪的transformer模型,它能够捕获视频序列中空间和时间信息的全局特征依赖关系.在五个具有挑战性的短期和长期基准上实现了SOTA性能,具有实时性,比 ...
- [BUUCTF]PWN——jarvisoj_level1
jarvisoj_level1 附件 步骤: 例行检查,32位程序,没有开任何保护 本地运行一下程序,看看大概的情况,可以看到输出了一个地址 32位ida载入,习惯性的检索程序里的字符串,没有发现可以 ...
- [BUUCTF]REVERSE——[BJDCTF 2nd]guessgame
[BJDCTF 2nd]guessgame 附件 步骤: 例行查壳儿,64位程序,没有壳儿 64位ida载入,习惯性的检索程序里的字符串,看到了一串类似flag的字符串,拿去提交,成功 BJD{S1m ...
- java 多线程:线程安全问题synchronized关键字解决
背景: 多个线程同时修改一个变量时,有概率导致两次修改其中某些次被覆盖. 例如:如下案例一个变量值为3,三个线程同时对其-1,如果按顺序执行,每次减完的结果应该是2,1,0.但实际运行中有可能变为0, ...