embcol.optimizers.DEGlobalOptimizer

class embcol.optimizers.DEGlobalOptimizer(problem, callback=(), population_size=20, mutation='best/1', diff_weight=(0.1, 0.3), crossover_prob=0.05, cost_tol=1e-08, cost_std_tol=1e-08, rng=None)[source]

Bases: BaseGlobalOptimizer

DE global optimizer.

Search a global optimum by the differential evolution (DE).

Parameters:
  • problem (embcol.problem.Problem) – Optimization problem.

  • callback (callable or sequence of callable, optional) – Function(s) called after each iteration. The signature of a function must be (params, cost, state) -> None, where params is a one-dimensional array of parameters of type numpy.ndarray, cost is a cost value of type float, and state is a dict object of str to float detailing an optimization state.

  • population_size (int, optional) – Population size.

  • mutation ({'best/1', 'rand/1'}, optional) – Mutation method.

  • diff_weight (float or iterable of float, optional) – Differential weight. The value must be in the range [0, 2]. If an iterable is given, the size must be 2, which are lower and upper bounds for dithering.

  • crossover_prob (float) – Crossover probability. The value must be in the range [0, 1].

  • cost_tol (float, optional) – Convergence tolerance for the cost.

  • cost_std_tol (float, optional) – Convergence tolerance for the standard deviation of costs of a population.

  • rng (rng-like, optional) – Random number generator. If nothing is given, a generator is initialized nondeterministically.

Inherited methods

optimize([max_n_iters, resume])

Run an optimization.