osmose.calibration.cmaes_runner

Covariance Matrix Adaptation Evolution Strategy (CMA-ES) wrapper.

CMA-ES typically converges in 2–3× fewer evaluations than scipy’s differential evolution on continuous noisy black-box problems in 20–50 dimensions. Use this when DE is converging slowly and the objective is reasonably smooth (no hard discontinuities).

Tier C2 of the speedup roadmap. The cma package is already in the venv.

Bound handling: cma 4.x defaults to BoundaryHandler=BoundTransform when bounds is set — a smooth bijective transform that maps R^D into the bounded hypercube, so the internal distribution adapts in unbounded space and candidates returned by es.ask() are always feasible. We rely on this default rather than the alternative BoundPenalty (clip-and-penalize), which would let the distribution mean drift outside bounds in high dim.

Determinism note: the seed argument seeds cma’s internal RNG, so single-worker runs are reproducible. With workers > 1 joblib’s task scheduling can interact with worker-side numpy RNG state in non-deterministic ways, so reproducibility is best-effort. For strict bit-for-bit reproducibility, run with workers=1 or ensure the objective seeds its own RNG explicitly per call.

Functions

run_cmaes(objective, bounds, x0[, sigma0, ...])

Optimise objective over bounds via CMA-ES.