DifferentialEvolution

Contents

Purpose:

The purpose of the driver.

Tutorials:

Tutorials demonstrating the application of this driver.

Driver Interface:

Driver-specific methods of the Python interface.

Configuration:

Configuration of the driver.

Purpose

The driver minimizes scalar function of one or more variables based on the Differential Evolution (DE) method. This method is suitable for the global minimization of inexpensive functions without known derivatives.

Differential Evolution (DE) is an evolutionary optimization algorithm inspired by the mutation, crossover and selection processes occurring in nature [1]. In the mutation step, for each member \(\mathbf{p}_i\) of the population, a mutated genome is created as \(\mathbf{p}_{\rm mut} = \mathbf{a} + F(\mathbf{b} - \mathbf{c})\), where \(F\) is the differential weight and \(\mathbf{a}, \mathbf{b}, \mathbf{c}\) are distinct randomly selected population members. Random entries of \(\mathbf{p}_i\), selected according to a crossover probability, are replaced with the mutated genome \(\mathbf{p}_{\rm mut}\), forming a new candidate. The candidate replaces \(\mathbf{p}_i\) in the next population if its objective value is lower.

Alternative drivers for the global minimization of inexpensive functions are CMAES and the ScipyMinimizer. The Differential Evolution driver is recommended if:

  • No gradient information are available.

  • The objective function has potentially many well-separated local minima.

For expensive objectives with evaluation times larger than a few seconds, the ActiveLearning driver is recommended.

Tutorials

Driver Interface

The driver instance can be obtained by Study.driver.

class jcmoptimizer.DifferentialEvolution(host, study_id, session)[source]

This class provides methods for retieving information of the result of the differential evolution.

property best_sample: dict[str, float | int | str]

Best sample with minimal objective value found during the minimization. Example:

for key, value in driver.best_sample.items():
   print(f"{key} = {value}")
describe()

Get description of all modules and their parameters that are used by the driver. Example:

description = driver.describe()
print(description["members"]["surrogates"]["0"])
Return type:

dict[str, Any]

Returns: A nested dictionary with description of submodules consisting

of a name and a descriptive text. If the entry describes a module, it has an additional "members" entry with dictionaries describing submodules and parameters.

get_state(path=None)

Get state of the driver. Example:

best_sample = driver.get_state(path="best_sample")
Parameters:

path (Optional[str]) – A dot-separated path to a submodule or parameter. If none, the full state is returned.

Return type:

dict[str, Any]

Returns: If path is None, a dictionary with information of driver state.

Note

A description of the meaning of each entry in the state can be retrieved by describe().

historic_parameter_values(path)

Get the values of an internal parameter for each iteration of the study. Example:

min_objective_values = driver.historic_parameter_values(
    path="acquisition_function.min_objective")
Parameters:

path (str) – A dot-separated path to the parameter.

Return type:

list[Any]

Note

A description of the meaning of each parameter can be retrieved by describe().

property min_objective: float

Minimal objective value found during the minimization. Example:

min_objective = driver.min_objective

Configuration

The configuration parameters can be set by calling, e.g.

study.configure(example_parameter1 = [1,2,3], example_parameter2 = True)

The driver allows to run num_initial minimizations starting from multiple initial samples in parallel. Only continous design parameters are minimized while discrete and categorial parameters are fixed to the values of the initial samples.

max_iter (int)

Maximum number of evaluations of the studied system.

Default: Infinite number of evaluations.

max_time (float)

Maximum run time of study in seconds. The time is counted from the moment, that the parameter is set or reset.

Default: inf

num_parallel (int)

Number of parallel evaluations of the studied system.

Default: 1

min_val (float)

The minimization is stopped when the observed objective value is below the specified minimum value.

Default: -inf

min_step (float)

The minimization is stopped when the Eucledian distance between consecutive sampling points in the design parameter space is below the specified value.

Default: 0.0

num_initial (int)

Number of independent initial optimizers.

Default: 1

max_num_optimizers (int)

If an optimizer has converged, it is restarted at another position. If max_num_optimizers have converged, the optimization is stopped.

Default: Infinite number of optimizers.

initial_samples (list[list])

List of initial samples each with dimension of the design space. The role of the initial samples is twofold. First, they are regarded as initial guess to the minimization. Once the num_initial populations have been initialized these samples replace the first (best) member. Second, if the design space contains discrete or categorial parameters, they can be specified for each DE minimizer by the value of the initial samples. If num_initial > len(initial_samples) the rest of the initial populations is chosen randomly.

Default: []

sobol_sequence (bool)

If true, all initial samples are taken from a Sobol sequence. This typically improves the coverage of the parameter space.

Default: True

popsize_multiplier (int)

A multiplier for setting the total population size. The population has popsize * len(x) individuals.

Default: 15

tol (float)

The optimizer stops when the mean of the population energies (objective function values), multiplied by tol is larger than the standard deviation of the population energies.

Default: 0.0

strategy (str)

The differential evolution strategy to use.

Default: 'best1bin' Choices: 'best1bin', 'best1exp', 'rand1exp', 'randtobest1exp', 'best2exp', 'rand2exp', 'randtobest1bin', 'best2bin', 'rand2bin', 'rand1bin'.

mutation (list[float])

Controls the range of the mutation constant also known as differential weight, being denoted by F. The entries should be in the range [0, 2]. The mutation constant is changed randomly on a generation by generation basis. The mutation constant for that generation is taken from U[min, max). This dithering can help speed convergence significantly. Increasing the mutation constant increases the search radius, but will slow down convergence.

Default: [0.5,1]

recombination (float)

The recombination constant, should be in the range [0, 1]. In the literature this is also known as the crossover probability, being denoted by CR. Increasing this value allows a larger number of mutants to progress into the next generation, but at the risk of population stability.

Default: 0.7