CMAES
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 using the Covariance Matrix Adaptation Evolution Strategy (CMA-ES). This method is suitable for the global minimization of inexpensive functions without known derivatives.
CMA-ES is an evolutionary algorithm [1]. It draws its \(N\) population members from a multivariate normal distribution \(\mathcal{N}(\mathbf{\mu}, \Sigma)\) with mean vector \(\mathbf{\mu} \in \mathbb{R}^d\) and covariance matrix \(\Sigma\in\mathbb{R}^{d\times d}\) where \(d\) is the dimensionality of the design space. After evaluating the objective value for each population member, it uses a weighted subset of \(M < N\) members with the lowest objective values to update the mean \(\mathbf{\mu}\) and covariance matrix \(\Sigma\) for the next iteration.
Alternative drivers for the global minimization of inexpensive functions are DifferentialEvolution and the ScipyMinimizer. The CMA-ES driver is recommended if:
No gradient information are available.
The minimization is performed w.r.t. discrete and categorial design parameters.
The observations are subject to noise. In this case CMA-ES is specifically suitable since for the determination of the population mean and covariance, many samples are used such that effects of noise can average out.
The objective function does not have multiple well-separated local minima. Otherwise, the multivariate Gaussian distribution can either only focus on one minimum, or the mean vector lies between several local minima such that many samples will have bad objective values.
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.CMAES(host, study_id, session)[source]
This class provides methods for retieving information of the result of the CMA-ES minimization.
- 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)
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
population_size (int)
The population size.
Default: Automatic choice \(4 + \lfloor 3 * \log(N)\rfloor\) depending on problem dimension \(N\).
mean0 (list[float])
Initial mean vector of the multi-variate Gaussian distribution of the population. For each new population this value is updated. If the study is continued, the latest updated value will be used and
mean0
is disregarded.Default: Random choice.
sigma0 (float)
Initial standard deviation of the population. The problem is internally rescaled such that all variables lie in the interval [0,1]. The standard deviation is defined on these rescaled variables. For each new population this value is updated. If the study is continued, the latest updated value will be used and
sigma0
is disregarded.Default:
0.4