@

Das S, Suganthan P N. Differential Evolution: A Survey of the State-of-the-Art[J]. IEEE Transactions on Evolutionary Computation, 2011, 15(1): 4-31.

@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) 的综述, 由于对这类方法并不熟悉, 只能简单地做个记录.

主要内容

考虑如下问题,

\[\min \: f(X),
\]

其中\(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:
  1. Mutation step:
\[V_{i,G} = X_{r_1^i,G} + F \cdot (X_{r_2^i,G} - X_{r_3^i,G}).
\]
  1. Crossover step: 按照如下方式生成\(U_{i,G}=(u_{1,i,G},\ldots, u_{D,i,G})\)
\[u_{j,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.
\]
  1. Selection step:
\[X_{i,G} =
\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\), 然后

\[u_{j,i,G} =
\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\):
\[L=L+1.
\]

DE/best/1

\[V_{i,G}=X_{best,G} + F\cdot (X_{r_1^i,G} - X_{r_2^i,G}),
\]

其中\(X_{best,G}\)是\(P_{G}\)中的最优的点.

DE/best/2

\[V_{i,G}=X_{best,G} + F\cdot (X_{r_1^i,G} - X_{r_2^i,G}) + F\cdot (X_{r_3^i,G} - X_{r_4^i,G}).
\]

DE/rand/2

\[V_{i,G}=X_{r_1^i,G} + F\cdot (X_{r_2^i,G} - X_{r_3^i,G}) + F\cdot (X_{r_4^i,G} - X_{r_5^i,G}),
\]

超参数的选择

真的没有细看, 文中粗略地介绍了几处, 还有很多需要查原文.

\(F\)的选择

有的推荐\([0.4, 1]\)(最佳0.5), 有的推荐\(0.6\), 有的推荐\([0.4, 0.95]\)(最佳0.9).

还有一些自适应的选择, 如

\[F =
\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吗?

\[F_{i,G+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]\).

还有

\[Cr_{i,G+1} =
\left \{ \begin{array}{ll}
\mathrm{rand}[0, 1] & with \: probability \:\tau \\
Cr_{i,G} & else,
\end{array} \right.
\]

一些连续变体

A

\[p=f(X_{r_1})+f(X_{r_2}) + f(X_{r_3}) \\
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\)是给定的):

\[\begin{array}{ll}
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}
\]

否则

\[V_{i,G+1} = X_{r_1} + F \cdot (X_{r_2}-X_{r_3}).
\]

B

\[U_{i,G}=X_{i, G}+k_i \cdot (X_{r_1,G}-X_{i,G})+F' \cdot (X_{r_2,G}-X_{r_3, G}),
\]

其中\(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\)中的最优点.

\[V_{i,G}= w \cdot g_{i, G} + (1-w) \cdot L_{i, G}.
\]

G

剩下的在复杂环境下的应用就不记录了(只是单纯讲了该怎么做).

一些缺点

  1. 高维问题不易处理;
  2. 容易被一些问题欺骗, 而现如局部最优解;
  3. 对不能分解的函数效果不是很好;
  4. 路径往往不会太大(即探索不充分);
  5. 缺少收敛性的理论的保证.

代码

\(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的更多相关文章

  1. SBX(Simulated binary crossover)模拟二进制交叉算子和DE(differential evolution)差分进化算子

    一起来学演化计算-SBX(Simulated binary crossover)模拟二进制交叉算子和DE(differential evolution)差分进化算子 觉得有用的话,欢迎一起讨论相互学习 ...

  2. Image Processing and Analysis_8_Edge Detection:Edge and line oriented contour detection State of the art ——2011

    此主要讨论图像处理与分析.虽然计算机视觉部分的有些内容比如特 征提取等也可以归结到图像分析中来,但鉴于它们与计算机视觉的紧密联系,以 及它们的出处,没有把它们纳入到图像处理与分析中来.同样,这里面也有 ...

  3. differential evolution代码实例(DE算法)

    DE算法是遗传算法中一种比较流行的算法,这种算法比较简单,速度也比较快,下面给出一份示例代码 clear all; close all; clc 2 %Function to be minimized ...

  4. 翻新并行程序设计的认知整理版(state of the art parallel)

    近几年,业内对并行和并发积累了丰富的经验.有了较深刻的理解.但之前积累的大量教材,在当今的软硬件体系下.反而都成了负面教材.所以,有必要加强宣传,翻新大家的认知. 首先.天地倒悬,结论先行:当你须要并 ...

  5. 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 ...

  6. awesome-RecSys

    https://github.com/jihoo-kim/awesome-RecSys?fbclid=IwAR1m6OebmqO9mfLV1ta4OTihQc9Phw8WNS4zdr5IeT1X1OL ...

  7. 差分进化算法 DE-Differential Evolution

    差分进化算法 (Differential Evolution)   Differential Evolution(DE)是由Storn等人于1995年提出的,和其它演化算法一样,DE是一种模拟生物进化 ...

  8. 论文学习-深度学习目标检测2014至201901综述-Deep Learning for Generic Object Detection A Survey

    目录 写在前面 目标检测任务与挑战 目标检测方法汇总 基础子问题 基于DCNN的特征表示 主干网络(network backbone) Methods For Improving Object Rep ...

  9. 机器学习经典论文/survey合集

    Active Learning Two Faces of Active Learning, Dasgupta, 2011 Active Learning Literature Survey, Sett ...

随机推荐

  1. 线性表A,B顺序存储合并

    线性表A,B顺序存储合并 有两张非递增有序的线性表A,B,采用顺序存储结构,两张表合并用c表存,要求C为非递减有序的,然后删除C表中值相同的多余元素.元素类型为整型 输入格式: 第一行输入输入表A的各 ...

  2. 日常Java 2021/10/18

    Vecter类实现了一个动态数组,不同于ArrayList的是,Vecter是同步访问的, Vecter主要用在事先不知道数组的大小或可以改变大小的数组 Vecter类支持多种构造方法:Vecter( ...

  3. 重学Git(一)

    一.最最最基础操作 # 初始化仓库 git init # 添加文件到暂存区 git add readme.md # 提交 git commit -m 'wrote a readme file' 二.简 ...

  4. CAS你知道吗

    1.比较并交换 CASDemo /** * CAS => compareAndSet * 比较并交换 */ public class CASDemo { public static void m ...

  5. mysql 间隙锁专题

    本文研究记录mysql间隙锁,涉及以下情况 唯一索引 非唯一索引 范围更新 等值更新 mysql8 mysql7 RR RC 数据准备 mysql> select * from vodb.tes ...

  6. jenkins之代码回滚

    #:通过传参数方式 #:保存后就会看到这样 #;:我们在jenkins服务器写一个脚本 root@ubuntu:~# mkdir /root/script/web1 -pv mkdir: create ...

  7. Linux学习 - 文本编辑器Vim

    一.Vim工作模式 二.命令 插入 a 光标后插入 A 光标所在行尾插入 i 光标前插入 I 光标所在行首插入 o 光标下插入新行 O 光标上插入新行   删除 x 删除光标处字符 nx 删除光标处后 ...

  8. OC简单介绍

    一.OC与C的对比 关键字 OC新增的关键字在使用时,注意部分关键字以"@"开头 方法->函数 定义与实现 数据类型 新增:BOOL/NSObject/id/SEL/bloc ...

  9. zabbix之微信报警

    #:先在企业微信注册一个企业微信号 #:注册好之后,进入微信 #:测试一下 #:获取access_token #:开始获取 #:获取 #:在server端安装pip root@ubuntu:~# ap ...

  10. 基于docker 操作mysql5.7

    1. 安装好 docker 2. 拉取 mysql5.7 镜像: docker pull mysql:5.7 其他版本 mysql:https://hub.docker.com/_/mysql?tab ...