shark::LMCMA Class Reference

Implements a Limited-Memory-CMA. More...

#include <shark/Algorithms/DirectSearch/LMCMA.h>

+ Inheritance diagram for shark::LMCMA:

Public Member Functions

 LMCMA (random::rng_type &rng=random::globalRng)
 Default c'tor. More...
 
std::string name () const
 From INameable: return the class name. More...
 
unsigned suggestLambda (unsigned int dimension)
 Calculates lambda for the supplied dimensionality n. More...
 
double suggestMu (unsigned int lambda)
 Calculates mu for the supplied lambda and the recombination strategy. More...
 
void init (ObjectiveFunctionType const &function, SearchPointType const &p)
 Initializes the algorithm for the supplied objective function. More...
 
void init (ObjectiveFunctionType const &function, SearchPointType const &initialSearchPoint, unsigned int lambda, double mu, double initialSigma)
 Initializes the algorithm for the supplied objective function. More...
 
void step (ObjectiveFunctionType const &function)
 Executes one iteration of the algorithm. More...
 
double sigma () const
 Accesses the current step size. More...
 
RealVector const & mean () const
 Accesses the current population mean. More...
 
RealVector const & weights () const
 Accesses the current weighting vector. More...
 
RealVector const & evolutionPath () const
 Accesses the evolution path for the covariance matrix update. More...
 
unsigned int mu () const
 Returns the size of the parent population \(\mu\). More...
 
unsigned int & mu ()
 Returns a mutabl rference to the size of the parent population \(\mu\). More...
 
unsigned int lambda () const
 Returns a immutable reference to the size of the offspring population \(\mu\). More...
 
unsigned int & lambda ()
 Returns a mutable reference to the size of the offspring population \(\mu\). More...
 
- Public Member Functions inherited from shark::AbstractSingleObjectiveOptimizer< RealVector >
std::size_t numInitPoints () const
 By default most single objective optimizers only require a single point. More...
 
virtual void init (ObjectiveFunctionType const &function, std::vector< SearchPointType > const &initPoints)
 Initialize the optimizer for the supplied objective function using a set of initialisation points. More...
 
virtual const SolutionTypesolution () const
 returns the current solution of the optimizer More...
 
- Public Member Functions inherited from shark::AbstractOptimizer< RealVector, double, SingleObjectiveResultSet< RealVector > >
const Featuresfeatures () const
 
virtual void updateFeatures ()
 
bool requiresValue () const
 
bool requiresFirstDerivative () const
 
bool requiresSecondDerivative () const
 
bool canSolveConstrained () const
 
bool requiresClosestFeasible () const
 
virtual ~AbstractOptimizer ()
 
virtual void init (ObjectiveFunctionType const &function)
 Initialize the optimizer for the supplied objective function. More...
 
- Public Member Functions inherited from shark::INameable
virtual ~INameable ()
 
- Public Member Functions inherited from shark::ISerializable
virtual ~ISerializable ()
 Virtual d'tor. More...
 
virtual void read (InArchive &archive)
 Read the component from the supplied archive. More...
 
virtual void write (OutArchive &archive) const
 Write the component to the supplied archive. More...
 
void load (InArchive &archive, unsigned int version)
 Versioned loading of components, calls read(...). More...
 
void save (OutArchive &archive, unsigned int version) const
 Versioned storing of components, calls write(...). More...
 
 BOOST_SERIALIZATION_SPLIT_MEMBER ()
 

Additional Inherited Members

- Public Types inherited from shark::AbstractSingleObjectiveOptimizer< RealVector >
typedef base_type::SearchPointType SearchPointType
 
typedef base_type::SolutionType SolutionType
 
typedef base_type::ResultType ResultType
 
typedef base_type::ObjectiveFunctionType ObjectiveFunctionType
 
- Public Types inherited from shark::AbstractOptimizer< RealVector, double, SingleObjectiveResultSet< RealVector > >
enum  Feature
 Models features that the optimizer requires from the objective function. More...
 
typedef RealVector SearchPointType
 
typedef double ResultType
 
typedef SingleObjectiveResultSet< RealVector > SolutionType
 
typedef AbstractObjectiveFunction< RealVector, ResultTypeObjectiveFunctionType
 
typedef TypedFlags< FeatureFeatures
 
typedef TypedFeatureNotAvailableException< FeatureFeatureNotAvailableException
 
- Protected Member Functions inherited from shark::AbstractOptimizer< RealVector, double, SingleObjectiveResultSet< RealVector > >
void checkFeatures (ObjectiveFunctionType const &objectiveFunction)
 Convenience function that checks whether the features of the supplied objective function match with the required features of the optimizer. More...
 
- Protected Attributes inherited from shark::AbstractSingleObjectiveOptimizer< RealVector >
SolutionType m_best
 Current solution of the optimizer. More...
 
- Protected Attributes inherited from shark::AbstractOptimizer< RealVector, double, SingleObjectiveResultSet< RealVector > >
Features m_features
 

Detailed Description

Implements a Limited-Memory-CMA.

This is the algorithm as proposed in Ilya Loshchilov, "A Computationally Efficient Limited Memory CMA-ES for Large Scale Optimization" with a few corrections regarding the covariance matrix update.

The algorithm stores a subset of previous evolution path vectors and approximates the covariance matrix based on this. This algorithm only requires O(nm) memory, where n is the dimensionality and n the problem dimensionality. To be more exact, 2*m vectors of size n are stored to calculate the matrix-vector product with the choelsky factor of the covariance matrix in O(mn).

The algorithm uses the population based step size adaptation strategy as proposed in the same paper.

Definition at line 198 of file LMCMA.h.

Constructor & Destructor Documentation

◆ LMCMA()

shark::LMCMA::LMCMA ( random::rng_type &  rng = random::globalRng)
inline

Default c'tor.

Definition at line 202 of file LMCMA.h.

Member Function Documentation

◆ evolutionPath()

RealVector const& shark::LMCMA::evolutionPath ( ) const
inline

Accesses the evolution path for the covariance matrix update.

Definition at line 317 of file LMCMA.h.

◆ init() [1/2]

void shark::LMCMA::init ( ObjectiveFunctionType const &  function,
SearchPointType const &  p 
)
inlinevirtual

Initializes the algorithm for the supplied objective function.

Implements shark::AbstractSingleObjectiveOptimizer< RealVector >.

Definition at line 227 of file LMCMA.h.

References lambda.

◆ init() [2/2]

void shark::LMCMA::init ( ObjectiveFunctionType const &  function,
SearchPointType const &  initialSearchPoint,
unsigned int  lambda,
double  mu,
double  initialSigma 
)
inline

Initializes the algorithm for the supplied objective function.

Definition at line 239 of file LMCMA.h.

References lambda.

◆ lambda() [1/2]

unsigned int shark::LMCMA::lambda ( ) const
inline

Returns a immutable reference to the size of the offspring population \(\mu\).

Definition at line 332 of file LMCMA.h.

◆ lambda() [2/2]

unsigned int& shark::LMCMA::lambda ( )
inline

Returns a mutable reference to the size of the offspring population \(\mu\).

Definition at line 337 of file LMCMA.h.

◆ mean()

RealVector const& shark::LMCMA::mean ( ) const
inline

Accesses the current population mean.

Definition at line 307 of file LMCMA.h.

◆ mu() [1/2]

unsigned int shark::LMCMA::mu ( ) const
inline

Returns the size of the parent population \(\mu\).

Definition at line 322 of file LMCMA.h.

◆ mu() [2/2]

unsigned int& shark::LMCMA::mu ( )
inline

Returns a mutabl rference to the size of the parent population \(\mu\).

Definition at line 327 of file LMCMA.h.

◆ name()

std::string shark::LMCMA::name ( ) const
inlinevirtual

From INameable: return the class name.

Reimplemented from shark::INameable.

Definition at line 208 of file LMCMA.h.

◆ sigma()

double shark::LMCMA::sigma ( ) const
inline

Accesses the current step size.

Definition at line 302 of file LMCMA.h.

◆ step()

void shark::LMCMA::step ( ObjectiveFunctionType const &  function)
inlinevirtual

Executes one iteration of the algorithm.

Implements shark::AbstractOptimizer< RealVector, double, SingleObjectiveResultSet< RealVector > >.

Definition at line 278 of file LMCMA.h.

References lambda, and shark::searchPoint().

◆ suggestLambda()

unsigned shark::LMCMA::suggestLambda ( unsigned int  dimension)
inline

Calculates lambda for the supplied dimensionality n.

Definition at line 212 of file LMCMA.h.

References lambda.

◆ suggestMu()

double shark::LMCMA::suggestMu ( unsigned int  lambda)
inline

Calculates mu for the supplied lambda and the recombination strategy.

Definition at line 220 of file LMCMA.h.

◆ weights()

RealVector const& shark::LMCMA::weights ( ) const
inline

Accesses the current weighting vector.

Definition at line 312 of file LMCMA.h.


The documentation for this class was generated from the following file: