libcmaes
A C++11 library for stochastic optimization with CMA-ES
 All Classes Namespaces Functions Variables Typedefs
Classes | Typedefs | Enumerations | Functions
libcmaes Namespace Reference

linear scaling of the parameter space to achieve similar sensitivity across all components. More...

Classes

class  ACMSurrogateStrategy
 ACM Surrogate strategy for CMA-ES, follows: 'Surrogate-Assisted Evolutionary Algorithms', Ilya Loshchilov, PhD Thesis, Universite Paris-Sud 11, 2013. http://www.loshchilov.com/phd.html see Chapter 4. More...
 
class  ACovarianceUpdate
 Active Covariance Matrix update. This implementation closely follows N. Hansen, R. Ros, "Benchmarking a Weighted Negative Covariance Matrix Update on the BBOB-2010 Noiseless Testbed", GECCO'10, 2010. More...
 
class  BIPOPCMAStrategy
 Implementation of the BIPOP flavor of CMA-ES, with restarts that control the population of offsprings used in the update of the distribution parameters in order to alternate between local and global searches for the objective. More...
 
class  Candidate
 candidate solution point, in function parameter space. More...
 
class  CMAParameters
 Parameters for various flavors of the CMA-ES algorithm. More...
 
class  CMASolutions
 Holder of the set of evolving solutions from running an instance of CMA-ES. More...
 
class  CMAStopCriteria
 CMA-ES termination criteria, see reference paper in cmastrategy.h. More...
 
class  CMAStrategy
 This is an implementation of CMA-ES. It uses the reference algorithm and termination criteria of the following paper: Hansen, N. (2009). Benchmarking a BI-Population CMA-ES on the BBOB-2009 Function Testbed. Workshop Proceedings of the GECCO Genetic and Evolutionary Computation Conference, ACM, pp. 2389-2395 See https://www.lri.fr/~hansen/publications.html for more information. More...
 
class  contour
 function contour as a set of points and values. More...
 
class  CovarianceUpdate
 Covariance Matrix update. This is an implementation closely follows: Hansen, N. (2009). Benchmarking a BI-Population CMA-ES on the BBOB-2009 Function Testbed. Workshop Proceedings of the GECCO Genetic and Evolutionary Computation Conference, ACM, pp. 2389-2395. More...
 
class  errstats
 
class  ESOptimizer
 an optimizer main class. More...
 
class  ESOStrategy
 Main class describing an evolutionary optimization strategy. Every algorithm in libcmaes descends from this class, and bring its functionalities to an ESOptimizer object. More...
 
class  fcross
 function crossing as point. More...
 
class  GenoPheno
 
class  IPOPCMAStrategy
 Implementation of the IPOP flavor of CMA-ES, with restarts that linearly increase the population of offsprings used in the update of the distribution parameters. More...
 
class  linScalingStrategy
 
class  NoBoundStrategy
 
class  NoScalingStrategy
 
class  OptHopStrategy
 
class  Parameters
 Generic class for Evolution Strategy parameters. More...
 
class  pli
 profile likelihood object holder as a set of points and values. More...
 
class  pwqBoundStrategy
 
class  RankedCandidate
 
class  SimpleSurrogateStrategy
 Simple surrogate strategy: trains every n steps, and exploits in between, mostly as an example and for testing / debugging surrogates. This strategy overrides the ask/eval/tell functions of the base optimization strategy. More...
 
class  StopCriteria
 
class  SurrogateStrategy
 Surrogate base class, to be derived in order to create strategy to be used along with CMA-ES. More...
 
class  VDCMAUpdate
 VD-CMA update that is a linear time/space variant of CMA-ES This is an implementation that closely follows: Y. Akimoto, A. Auger and N. Hansen: Comparison-Based Natural Gradient Optimization in High Dimension. In Proceedings of Genetic and Evolutionary Computation Conference (2014) More...
 

Typedefs

template<class TGenoPheno >
using StopCriteriaFunc = std::function< int(const CMAParameters< TGenoPheno > &cmap, const CMASolutions &cmas)>
 
template<class TGenoPheno >
using eostrat = ESOStrategy< CMAParameters< TGenoPheno >, CMASolutions, CMAStopCriteria< TGenoPheno > >
 
typedef std::function< double(const
double *, const int &n)> 
FitFunc
 
typedef std::function< dVec(const
double *, const int &n)> 
GradFunc
 
typedef std::function< void(const
dMat &, const dMat &)> 
EvalFunc
 
typedef std::function< dMat(void)> AskFunc
 
typedef std::function< void(void)> TellFunc
 
template<class TParameters , class TSolutions >
using ProgressFunc = std::function< int(const TParameters &, const TSolutions &)>
 
template<class TParameters , class TSolutions >
using PlotFunc = std::function< int(const TParameters &, const TSolutions &, std::ofstream &fplotstream)>
 
typedef std::function< void(const
double *, double *, const int &)> 
TransFunc
 
typedef std::function< int(const
std::vector< Candidate >
&, const dMat &)> 
CSurrFunc
 function to train a surrogate model More...
 
typedef std::function< int(std::vector
< Candidate > &, const dMat &)> 
SurrFunc
 function to predict from a surrogate model More...
 

Enumerations

enum  CMAStopCritType {
  CONT = 0, AUTOMAXITER = 7, TOLHISTFUN = 1, EQUALFUNVALS = 5,
  TOLX = 2, TOLUPSIGMA = -13, STAGNATION = 6, CONDITIONCOV = -15,
  NOEFFECTAXIS = 3, NOEFFECTCOOR = 4, MAXFEVALS = 8, MAXITER = 9,
  FTARGET = 10
}
 

Functions

template<class TGenoPheno = GenoPheno<NoBoundStrategy>>
CMASolutions cmaes (FitFunc &func, CMAParameters< TGenoPheno > &parameters, ProgressFunc< CMAParameters< TGenoPheno >, CMASolutions > &pfunc=CMAStrategy< CovarianceUpdate, TGenoPheno >::_defaultPFunc, GradFunc gfunc=nullptr, const CMASolutions &solutions=CMASolutions(), PlotFunc< CMAParameters< TGenoPheno >, CMASolutions > &pffunc=CMAStrategy< CovarianceUpdate, TGenoPheno >::_defaultFPFunc)
 
std::ostream & operator<< (std::ostream &out, const CMASolutions &cmas)
 
double median (std::vector< double > scores)
 
template<class TCovarianceUpdate , class TGenoPheno >
int pfuncdef_impl (const CMAParameters< TGenoPheno > &cmaparams, const CMASolutions &cmasols)
 
template<class TCovarianceUpdate , class TGenoPheno >
int fpfuncdef_full_impl (const CMAParameters< TGenoPheno > &cmaparams, const CMASolutions &cmasols, std::ofstream &fplotstream)
 
template<class TCovarianceUpdate , class TGenoPheno >
int fpfuncdef_impl (const CMAParameters< TGenoPheno > &cmaparams, const CMASolutions &cmasols, std::ofstream &fplotstream)
 
std::ostream & operator<< (std::ostream &out, const contour &c)
 
template<typename T >
int sgn (T val)
 
std::ostream & LOG (const std::string &severity, std::ostream &out=std::cout)
 
std::ostream & LOG_IF (const std::string &severity, const bool &condition, std::ostream &out=std::cout)
 
template<class TGenoPheno = GenoPheno<NoBoundStrategy>>
CMASolutions surrcmaes (FitFunc &func, CMAParameters< TGenoPheno > &parameters)
 

Detailed Description

linear scaling of the parameter space to achieve similar sensitivity across all components.

CMA-ES, Covariance Matrix Adaptation Evolution Strategy Copyright (c) 2014 Inria Author: Emmanuel Benazera emman.nosp@m.uel..nosp@m.benaz.nosp@m.era@.nosp@m.lri.f.nosp@m.r

This file is part of libcmaes.

libcmaes is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

libcmaes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with libcmaes. If not, see http://www.gnu.org/licenses/.

CMA-ES, Covariance Matrix Adaptation Evolution Strategy Copyright (c) 2014 INRIA Author: Emmanuel Benazera emman.nosp@m.uel..nosp@m.benaz.nosp@m.era@.nosp@m.lri.f.nosp@m.r

This file is part of libcmaes.

libcmaes is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

libcmaes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with libcmaes. If not, see http://www.gnu.org/licenses/.

CMA-ES, Covariance Matrix Adaptation Evolution Strategy Copyright (c) 2014 Inria Author: Emmanuel Benazera emman.nosp@m.uel..nosp@m.benaz.nosp@m.era@.nosp@m.lri.f.nosp@m.r

This file is part of libcmaes.

libcmaes is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

libcmaes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with libcmaes. If not, see http://www.gnu.org/licenses/. This is based on Nikolaus Hansen's code from the C version of CMA-ES, see boundary_transformation.c from the package available from https://www.lri.fr/~hansen/cmaes_inmatlab.html#C

CMA-ES, Covariance Matrix Adaptation Evolution Strategy Copyright (c) 2014 Inria Author: Emmanuel Benazera emman.nosp@m.uel..nosp@m.benaz.nosp@m.era@.nosp@m.lri.f.nosp@m.r

This file is part of libcmaes.

libcmaes is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

libcmaes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with libcmaes. If not, see http://www.gnu.org/licenses/. Parts of this code are rewrittent from Y. Akimoto original code for Y. Akimoto, A. Auger and N. Hansen, Comparison-Based Natural Gradient Optimization in High Dimension, GECCO-2014.

Typedef Documentation

typedef std::function<int (const std::vector<Candidate>&, const dMat&)> libcmaes::CSurrFunc

function to train a surrogate model

Parameters
candidatesset of points along with objective function value
cova possibly empty covariance matrix in order to re-scale points before training
Returns
training status
typedef std::function<int (std::vector<Candidate>&, const dMat&)> libcmaes::SurrFunc

function to predict from a surrogate model

Parameters
candidatesset of points for which value is to be predicted
cova possibly empty covariance matrix in order to re-scale points before predicting
Returns
prediction status