# Cmaes

Source: https://docs.q-ctrl.com/references/boulder-opal/boulderopal/closed_loop/Cmaes

```python
class boulderopal.closed_loop.Cmaes(bounds, initial_mean=None, initial_step_size=None, population_size=None, seed=None)
```

The covariance matrix adaptation evolution strategy (CMA-ES) optimizer.

### Parameters
* **bounds** ([*Bounds*](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/closed_loop/Bounds.md#boulderopal.closed_loop.Bounds)) – The bounds on the test points.
* **initial_mean** (*np.ndarray* *or* *None* *,* *optional*) – The per-parameter initial mean for the multivariate normal distribution.
  Defaults to None, in which case a random value inside the bounds is used for each parameter.
  If set, each parameter’s mean must be within its corresponding bounds.
* **initial_step_size** (*float* *or* *None* *,* *optional*) – The initial step size for the multivariate normal distribution from which new test
  points are sampled.
  Defaults to one.
* **population_size** (*int* *or* *None* *,* *optional*) – The population size of the test candidates. It is recommended to use a population size of
  at least $P = 4 + \lfloor 3 \times \log N \rfloor$, where $N$ is the number of
  optimizable parameters, $\log$ is the natural logarithm, and $\lfloor x \rfloor$
  is the floor function.
  Defaults to $P$.
* **seed** (*int* *or* *None* *,* *optional*) – Seed for the random number generator used in the optimizer.
  If set, must be a non-negative integer.
  Use this option to generate deterministic results from the optimizer.

## Notes

The CMA-ES optimizer uses a multivariate normal distribution to generate new test points.
From an initial_mean and initial_step_size, this distribution is continually
updated using an evolutionary strategy, with each update depending on the previous values and
the current set of results.
New test points are sampled from the distribution until convergence is reached.

For more detail on CMA-ES see [CMA-ES](https://en.wikipedia.org/wiki/CMA-ES) on Wikipedia.
