libcmaes 0.10.2
A C++11 library for stochastic optimization with CMA-ES
Loading...
Searching...
No Matches
cmastrategy.h
1
22#ifndef CMASTRATEGY_H
23#define CMASTRATEGY_H
24
25#include <libcmaes/esostrategy.h>
26#include <libcmaes/cmaparameters.h>
27#include <libcmaes/cmasolutions.h>
28#include <libcmaes/cmastopcriteria.h>
29#include <libcmaes/covarianceupdate.h>
30#include <libcmaes/acovarianceupdate.h>
31#include <libcmaes/vdcmaupdate.h>
32#include <libcmaes/eigenmvn.h>
33#include <fstream>
34
35namespace libcmaes
36{
37
44 template <class TCovarianceUpdate,class TGenoPheno=GenoPheno<NoBoundStrategy>>
45 class CMAES_EXPORT CMAStrategy : public ESOStrategy<CMAParameters<TGenoPheno>,CMASolutions,CMAStopCriteria<TGenoPheno> >
46 {
47 public:
52
58 CMAStrategy(FitFunc &func,
60
67 CMAStrategy(FitFunc &func,
69 const CMASolutions &cmasols);
70
72
78 dMat ask();
79
83 void tell();
84
89 bool stop();
90
101 int optimize(const EvalFunc &evalf, const AskFunc &askf, const TellFunc &tellf);
102
111 {
112 return optimize(std::bind(&ESOStrategy<CMAParameters<TGenoPheno>,CMASolutions,CMAStopCriteria<TGenoPheno>>::eval,this,std::placeholders::_1,std::placeholders::_2),
115 }
116
121 void plot();
122
123 protected:
126 std::ofstream *_fplotstream = nullptr;
128 public:
131 };
132
133}
134
135#endif
Definition eigenmvn.h:109
Holder of the set of evolving solutions from running an instance of CMA-ES.
Definition cmasolutions.h:42
This is an implementation of CMA-ES. It uses the reference algorithm and termination criteria of the ...
Definition cmastrategy.h:46
static PlotFunc< CMAParameters< TGenoPheno >, CMASolutions > _defaultFPFunc
Definition cmastrategy.h:130
int optimize()
Finds the minimum of the objective function. It makes alternate calls to ask(), tell() and stop() unt...
Definition cmastrategy.h:110
Eigen::EigenMultivariateNormal< double > _esolver
Definition cmastrategy.h:124
static ProgressFunc< CMAParameters< TGenoPheno >, CMASolutions > _defaultPFunc
Definition cmastrategy.h:129
CMAStopCriteria< TGenoPheno > _stopcriteria
Definition cmastrategy.h:125
Main class describing an evolutionary optimization strategy. Every algorithm in libcmaes descends fro...
Definition esostrategy.h:52
an optimizer main class.
Definition esoptimizer.h:72
int optimize()
finds the minimum of a function, by calling on the underlying procedure of the EOSOptimizer object,...
Definition esoptimizer.h:112
linear scaling of the parameter space to achieve similar sensitivity across all components.
Definition acovarianceupdate.h:30