Papers:
CMA-ES: The CMA Evolution Strategy: A Tutorial
Restart CMA-ES: A Restart CMA Evolution Strategy With Increasing Population Size
MA-ES: Simplify your covariance matrix adaptation evolution strategy
LM-CMA: LM-CMA: An alternative to L-BFGS for large-scale black box optimization
LM-MA: Large Scale Black-box Optimization by Limited-Memory Matrix Adaptation
ES for RL: Evolution Strategies as A Scalable Alternative to Reinforcement Learning
-
clone the repository
-
import eoa
-
select a problem already existed or define your only problem
-
select an algorithm to find the optimum.
You can look into eoa.py
to find more information about the usage.
TaskProb = Sphere(50, -50, 50)
Task = DE(TaskProb, 1000)
Task.run()
class Optimizer(object):
def __init__(self, func, maxgen, *arg1, **arg2):
"""
initialize attributes of the instance
:argument
self.f : problems to be solved
self.count : max generation number
self.opti_x : optimal solution
self.opti_f : optimal value
"""
self.f = func
self.maxgen = maxgen
self.opti_x = []
self.opti_f = 1e10
def step(self):
"""
a single step of the evolution process
"""
pass
def run(self):
"""
control the generation number
"""
pass
def output(self):
"""
return the solution and optimal value
return:
self.opti_x, self.opti_f
"""
pass
class Problem(object):
def __init__(self, dim, lb, up, *arg1, **arg2):
"""
initialize attributes of the problem
:argument
D : Dimension
lb : lower bound
ub : upper bound
"""
self.D = dim
self.lb = lb
self.ub = up
def evaluate(self, x):
"""
define the evaluate methods
:argument
x : input
"""
pass