pulsatrix
Loading...
Searching...
No Matches
cma_es.hpp File Reference

A CMA-ES-*style* ask-tell evolutionary strategy (Hansen & Ostermeier's Covariance Matrix Adaptation Evolution Strategy) for continuous hyperparameter search: an adaptive mean, a per-dimension adaptive scale (separable/diagonal covariance, Ros & Hansen, "A Simple Modification in CMA-ES Achieving Linear Time and Space Complexity," PPSN 2008), and an adaptive global step size. More...

#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>
#include <stdexcept>
#include <vector>
Include dependency graph for cma_es.hpp:

Go to the source code of this file.

Classes

struct  pulsatrix::CMAESState
 This algorithm's full adaptive state: the search mean, the global step size, and each dimension's own variance (the diagonal of the covariance matrix). More...
 
class  pulsatrix::CMAES
 RNG-driven ask-tell wrapper: caches the z-samples an Ask() call draws so a matching Tell() call can reuse them without the caller needing to track them. More...
 

Namespaces

namespace  pulsatrix
 

Functions

std::vector< std::vector< double > > pulsatrix::AskGivenSamples (const CMAESState &state, const std::vector< std::vector< double > > &z_samples)
 Pure core: decodes an explicit set of standard-normal sample vectors into offspring points, x_i = mean + sigma * sqrt(variances) (elementwise) * z_i.
 
CMAESState pulsatrix::TellGivenSamples (const CMAESState &state, const std::vector< std::vector< double > > &z_samples, const std::vector< std::vector< double > > &offspring, const std::vector< double > &fitness, double step_size_learning_rate, double scale_learning_rate)
 Pure core: given the offspring AskGivenSamples produced (same order), their maximization-convention fitness values, and the z_samples that produced them, returns the next generation's state.
 

Detailed Description

A CMA-ES-*style* ask-tell evolutionary strategy (Hansen & Ostermeier's Covariance Matrix Adaptation Evolution Strategy) for continuous hyperparameter search: an adaptive mean, a per-dimension adaptive scale (separable/diagonal covariance, Ros & Hansen, "A Simple Modification in CMA-ES Achieving Linear Time and Space Complexity," PPSN 2008), and an adaptive global step size.

Note
Deliberate simplifications from full CMA-ES, matching this campaign's own scope wording ("CMA-ES-*style*", not "CMA-ES"): (1) diagonal-only covariance (sep-CMA-ES), avoiding any eigendecomposition/Cholesky factorization – a real, published, citable reduction, not an invented shortcut; (2) equal-weight ("intermediate") recombination over the top mu offspring, the classic (mu/mu_I, lambda)-ES scheme that predates and still coexists with log-rank weighting in the literature, rather than the refined log-rank weights modern CMA-ES defaults to; (3) fixed learning rates for both the step-size and per-dimension-scale updates, rather than the full algorithm's mu_eff-dependent formulas and multi-generation evolution-path memory (cumulative step-size adaptation, the rank-one update). What is preserved exactly: the ask-tell interface, adaptive mean, per-dimension variance matching the empirical spread of successful steps (the essential idea evolution paths refine, not replace), and global step-size adaptation via the classic "successful step norm versus its expected norm under N(0,I)" comparison.