Evolution Strategies.

class opytimizer.optimizers.evolutionary.es.ES(params: Optional[Dict[str, Any]] = None)

An ES class, inherited from Optimizer.

This is the designed class to define ES-related variables and methods.


T. Bäck and H.–P. Schwefel. An Overview of Evolutionary Algorithms for Parameter Optimization. Evolutionary Computation (1993).

__init__(params: Optional[Dict[str, Any]] = None) → None

Initialization method.

Parameters:params – Contains key-value parameters to the meta-heuristics.

Ratio of children in the population.


Number of children.


Array of strategies.

compile(space: opytimizer.core.space.Space) → None

Compiles additional information that is used by this optimizer.

Parameters:space – A Space object containing meta-information.
_mutate_parent(agent: opytimizer.core.agent.Agent, index: int, function: opytimizer.core.function.Function) → opytimizer.core.agent.Agent

Mutates a parent into a new child (eq. 2).

  • agent – An agent instance to be reproduced.
  • index – Index of current agent.
  • function – A Function object that will be used as the objective function.

A mutated child.

Return type:


_update_strategy(index: int) → numpy.ndarray

Updates the strategy (eq. 5-10).

Parameters:index – Index of current agent.
Returns:The updated strategy.
Return type:(np.ndarray)
update(space: opytimizer.core.space.Space, function: opytimizer.core.function.Function) → None

Wraps Evolution Strategies over all agents and variables.

  • space – Space containing agents and update-related information.
  • function – A Function object that will be used as the objective function.