ES: Evolutionary Strategy

Contents

ES: Evolutionary Strategy#

Evolutionary Strategy is a well-known algorithm in evolutionary computation consisting of selection and mutation. The standard version has been proposed for real-valued optimization where a gaussian mutation is applied, and the selection is based on each individual’s fitness value.

In this implementation, the 1/7 rule creates seven times more offspring than individuals in the current population. The \(sigma\) values for the mutation are based on a meta-evolution of surviving individuals.

[1]:
from pymoo.algorithms.soo.nonconvex.es import ES
from pymoo.problems import get_problem
from pymoo.optimize import minimize

problem = get_problem("ackley", n_var=10)

algorithm = ES(n_offsprings=200, rule=1.0 / 7.0)

res = minimize(problem,
               algorithm,
               ("n_gen", 200),
               seed=1,
               verbose=False)

print("Best solution found: \nX = %s\nF = %s" % (res.X, res.F))
Best solution found:
X = [ 6.20750405e-08 -1.19247306e-06  2.59579287e-06 -8.70949813e-07
  7.78530099e-07  1.19484335e-07  1.22093334e-06  2.31173665e-07
  2.03891256e-06 -6.35412238e-07]
F = [5.00375523e-06]

API#

class pymoo.algorithms.soo.nonconvex.es.ES(n_offsprings: int | None = None, pop_size: int | None = None, rule: float = 0.14285714285714285, phi: float = 1.0, gamma: float = 0.85, sampling=<pymoo.operators.sampling.rnd.FloatRandomSampling object>, survival=<pymoo.algorithms.soo.nonconvex.ga.FitnessSurvival object>, output=<pymoo.util.display.single.SingleObjectiveOutput object>, **kwargs)[source]

Evolutionary Strategy (ES) algorithm for single-objective optimization.

Parameters:
  • n_offsprings – The number of individuals created in each iteration.

  • pop_size – The number of individuals which are surviving from the offspring population (non-elitist).

  • rule – The rule (ratio) of individuals surviving. This automatically either calculated n_offsprings or pop_size.

  • phi – Expected rate of convergence (usually 1.0).

  • gamma – If not None, some individuals are created using the differentials with this as a length scale.

  • sampling – The sampling method for creating the initial population.