| libcmaes 0.10.2
    A C++11 library for stochastic optimization with CMA-ES | 
Main class describing an evolutionary optimization strategy. Every algorithm in libcmaes descends from this class, and bring its functionalities to an ESOptimizer object. More...
#include <libcmaes/esostrategy.h>
 
  
| Public Member Functions | |
| ESOStrategy () | |
| dummy constructor. | |
| ESOStrategy (FitFunc &func, TParameters ¶meters) | |
| constructor | |
| ESOStrategy (FitFunc &func, TParameters ¶meters, const TSolutions &solutions) | |
| constructor for starting from an existing solution. | |
| dMat | ask () | 
| Generates a set of candidate points. | |
| void | eval (const dMat &candidates, const dMat &phenocandidates=dMat(0, 0)) | 
| Evaluates a set of candidates against the objective function. The procedure is multithreaded and stores both the candidates and their f-value into the _solutions object that bears the current set of potential solutions to the optimization problem. | |
| void | tell () | 
| Updates the state of the stochastic search, and prepares for the next iteration. | |
| bool | stop () | 
| Decides whether to stop the search for solutions. | |
| int | optimize (const EvalFunc &evalf, const AskFunc &askf, const TellFunc &tellf) | 
| Finds the minimum of the objective function. It makes alternative calls to ask(), tell() and stop() until one of the termination criteria triggers. | |
| void | inc_iter () | 
| increment iteration count. | |
| void | update_fevals (const int &evals) | 
| updates the consumed budget of objective function evaluations. | |
| void | set_gradient_func (GradFunc &gfunc) | 
| sets the gradient function, if available. | |
| void | set_progress_func (ProgressFunc< TParameters, TSolutions > &pfunc) | 
| Sets the possibly custom progress function, that is called in between every search step, and gives an outside user a simple way to witness progress of the algorithm, as well as to add custom termination criteria. | |
| void | start_from_solution (const TSolutions &sol) | 
| starts optimization from a given solution object. | |
| void | set_plot_func (PlotFunc< TParameters, TSolutions > &pffunc) | 
| Sets the possibly custom plot to file function, that is useful for storing into file various possibly custom variable values for each step until termination. | |
| dVec | gradf (const dVec &x) | 
| returns numerical gradient of objective function at x. | |
| dVec | gradgp (const dVec &x) const | 
| returns the numerical gradient of the objective function in phenotype space | |
| double | edm () | 
| computes expected distance to minimum (EDM). | |
| TSolutions & | get_solutions () | 
| returns reference to current solution object | |
| TParameters & | get_parameters () | 
| returns reference to current optimization parameters object | |
| double | fitfunc (const double *x, const int N) | 
| execute objective function | |
| void | uncertainty_handling () | 
| uncertainty handling scheme that computes and uncertainty level based on a dual candidate ranking. | |
| void | perform_uh (const dMat &candidates, const dMat &phenocandidates, int &nfcalls) | 
| uncertainty handling scheme that perform completely the reevaluation of solutions. | |
| void | select_candidates_uh (const dMat &candidates, const dMat &phenocandidates, dMat &candidates_uh) | 
| part of the ucertainty handling scheme that select which candidates should be reevaluated. | |
| void | eval_candidates_uh (const dMat &candidates, const dMat &candidates_uh, std::vector< RankedCandidate > &nvcandidates, int &nfcalls) | 
| part of the ucertainty handling scheme that evaluate the candidates to be reevaluated. | |
| void | set_candidates_uh (const std::vector< RankedCandidate > &nvcandidates) | 
| part of the ucertainty handling scheme that set the results of evaluation to the solutions. | |
| void | tpa_update () | 
| updates the two-point adaptation average rank difference for the step-size adaptation mechanism | |
| Candidate | best_solution () const | 
| void | set_initial_elitist (const bool &e) | 
| Protected Attributes | |
| FitFunc | _func | 
| int | _nevals | 
| int | _niter | 
| TSolutions | _solutions | 
| TParameters | _parameters | 
| ProgressFunc< TParameters, TSolutions > | _pfunc | 
| GradFunc | _gfunc = nullptr | 
| PlotFunc< TParameters, TSolutions > | _pffunc | 
| FitFunc | _funcaux | 
| bool | _initial_elitist = false | 
| Private Attributes | |
| std::mt19937 | _uhgen | 
| std::uniform_real_distribution | _uhunif | 
| Eigen::EigenMultivariateNormal< double > | _uhesolver | 
Main class describing an evolutionary optimization strategy. Every algorithm in libcmaes descends from this class, and bring its functionalities to an ESOptimizer object.
| libcmaes::ESOStrategy< TParameters, TSolutions, TStopCriteria >::ESOStrategy | ( | FitFunc & | func, | 
| TParameters & | parameters | ||
| ) | 
constructor
| func | function to minimize | 
| parameters | optimization parameters | 
| libcmaes::ESOStrategy< TParameters, TSolutions, TStopCriteria >::ESOStrategy | ( | FitFunc & | func, | 
| TParameters & | parameters, | ||
| const TSolutions & | solutions | ||
| ) | 
constructor for starting from an existing solution.
| func | objective function to minimize | 
| parameters | stochastic search parameters | 
| solution | solution object to start from | 
| dMat libcmaes::ESOStrategy< TParameters, TSolutions, TStopCriteria >::ask | ( | ) | 
Generates a set of candidate points.
| double libcmaes::ESOStrategy< TParameters, TSolutions, TStopCriteria >::edm | ( | ) | 
computes expected distance to minimum (EDM).
| void libcmaes::ESOStrategy< TParameters, TSolutions, TStopCriteria >::eval | ( | const dMat & | candidates, | 
| const dMat & | phenocandidates = dMat(0,0) | ||
| ) | 
Evaluates a set of candidates against the objective function. The procedure is multithreaded and stores both the candidates and their f-value into the _solutions object that bears the current set of potential solutions to the optimization problem.
| candidates | A matrix whose rows contain the candidates. | 
| phenocandidates | The candidates transformed into phenotype, leave empty if no pheno transform. | 
| 
 | inline | 
execute objective function
| x | point at which to execute the function | 
| N | dimension of array x | 
| 
 | inline | 
returns reference to current optimization parameters object
| 
 | inline | 
returns reference to current solution object
| dVec libcmaes::ESOStrategy< TParameters, TSolutions, TStopCriteria >::gradf | ( | const dVec & | x | ) | 
returns numerical gradient of objective function at x.
| x | point at which to compute the gradient | 
| dVec libcmaes::ESOStrategy< TParameters, TSolutions, TStopCriteria >::gradgp | ( | const dVec & | x | ) | const | 
returns the numerical gradient of the objective function in phenotype space
| x | point in genotype coordinates at which to compute the gradient | 
| int libcmaes::ESOStrategy< TParameters, TSolutions, TStopCriteria >::optimize | ( | const EvalFunc & | evalf, | 
| const AskFunc & | askf, | ||
| const TellFunc & | tellf | ||
| ) | 
Finds the minimum of the objective function. It makes alternative calls to ask(), tell() and stop() until one of the termination criteria triggers.
| evalf | custom eval function | 
| askf | custom ask function | 
| tellf | custom tell function | 
| 
 | inline | 
sets the gradient function, if available.
| gfunc | gradient function | 
| 
 | inline | 
Sets the possibly custom plot to file function, that is useful for storing into file various possibly custom variable values for each step until termination.
| pffunc | a stream to file output function | 
| 
 | inline | 
Sets the possibly custom progress function, that is called in between every search step, and gives an outside user a simple way to witness progress of the algorithm, as well as to add custom termination criteria.
| pfunc | a progress function | 
| 
 | inline | 
starts optimization from a given solution object.
| sol | the solution object to start search from. | 
| bool libcmaes::ESOStrategy< TParameters, TSolutions, TStopCriteria >::stop | ( | ) | 
Decides whether to stop the search for solutions.
| void libcmaes::ESOStrategy< TParameters, TSolutions, TStopCriteria >::update_fevals | ( | const int & | evals | ) | 
updates the consumed budget of objective function evaluations.
| evals | increment to the current consumed budget | 
| 
 | protected | 
the objective function.
| 
 | protected | 
gradient function, when available.
| 
 | protected | 
restarts from and re-injects best seen solution if not the final one.
| 
 | protected | 
number of function evaluations.
| 
 | protected | 
number of iterations.
| 
 | protected | 
the optimizer's set of static parameters, from inputs or internal.
| 
 | protected | 
possibly custom stream data to file function.
| 
 | protected | 
possibly custom progress function.
| 
 | protected | 
holder of the current set of solutions and the dynamic elemenst of the search state in general.
| 
 | private | 
random device used for uncertainty handling operations.