libcmaes
A C++11 library for stochastic optimization with CMA-ES
 All Classes Namespaces Functions Variables Typedefs
bipopcmastrategy.h
1 
22 #ifndef BIPOPCMASTRATEGY_H
23 #define BIPOPCMASTRATEGY_H
24 
25 #include "ipopcmastrategy.h"
26 #include <random>
27 
28 namespace libcmaes
29 {
36  template <class TCovarianceUpdate, class TGenoPheno>
37  class BIPOPCMAStrategy : public IPOPCMAStrategy<TCovarianceUpdate,TGenoPheno>
38  {
39  public:
45  BIPOPCMAStrategy(FitFunc &func,
46  CMAParameters<TGenoPheno> &parameters);
47 
54  BIPOPCMAStrategy(FitFunc &func,
55  CMAParameters<TGenoPheno> &parameters,
56  const CMASolutions &solutions);
57 
59 
63  void tell();
64 
72  int optimize(const EvalFunc &evalf,const AskFunc &askf,const TellFunc &tellf);
73 
84  int optimize()
85  {
86  return optimize(std::bind(&BIPOPCMAStrategy<TCovarianceUpdate,TGenoPheno>::eval,this,std::placeholders::_1,std::placeholders::_2),
89  }
90 
91  protected:
92  void r1();
93  void r2();
94 
95  private:
96  std::mt19937 _gen;
97  std::uniform_real_distribution<> _unif;
98  double _lambda_def;
99  double _lambda_l;
100  double _sigma_init; // to save the original value
101  double _max_fevals; // to save the original value
102  };
103 }
104 
105 #endif
Implementation of the IPOP flavor of CMA-ES, with restarts that linearly increase the population of o...
Definition: ipopcmastrategy.h:35
BIPOPCMAStrategy(FitFunc &func, CMAParameters< TGenoPheno > &parameters)
constructor.
Definition: bipopcmastrategy.cc:32
Holder of the set of evolving solutions from running an instance of CMA-ES.
Definition: cmasolutions.h:41
int optimize()
Finds the minimum of the objective function. It makes alternate calls to ask(), tell() and stop() unt...
Definition: bipopcmastrategy.h:84
linear scaling of the parameter space to achieve similar sensitivity across all components.
Definition: acovarianceupdate.cc:25
Parameters for various flavors of the CMA-ES algorithm.
Definition: cmaparameters.h:35
void tell()
Updates the covariance matrix and prepares for the next iteration.
Definition: bipopcmastrategy.cc:68
Implementation of the BIPOP flavor of CMA-ES, with restarts that control the population of offsprings...
Definition: bipopcmastrategy.h:37