shark::CMSA Class Reference

Implements the CMSA. More...

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

+ Inheritance diagram for shark::CMSA:

Public Member Functions

 CMSA ()
 Default c'tor. More...
 
std::string name () const
 From INameable: return the class name. More...
 
template<typename Container , typename Extractor >
RealVector cog (const Container &container, const Extractor &e)
 Calculates the center of gravity of the given population \( \in \mathbb{R}^d\). More...
 
SHARK_EXPORT_SYMBOL void read (InArchive &archive)
 Read the component from the supplied archive. More...
 
SHARK_EXPORT_SYMBOL void write (OutArchive &archive) const
 Write the component to the supplied archive. More...
 
SHARK_EXPORT_SYMBOL void init (ObjectiveFunctionType &function, SearchPointType const &p)
 Initializes the algorithm for the supplied objective function. More...
 
SHARK_EXPORT_SYMBOL void step (ObjectiveFunctionType const &function)
 Executes one iteration of the algorithm. More...
 
std::size_t mu () const
 Accesses the size of the parent population. More...
 
std::size_t & mu ()
 Accesses the size of the parent population, allows for l-value semantics. More...
 
std::size_t lambda () const
 Accesses the size of the offspring population. More...
 
std::size_t & lambda ()
 Accesses the size of the offspring population, allows for l-value semantics. More...
 
- Public Member Functions inherited from shark::AbstractSingleObjectiveOptimizer< RealVector >
virtual void init (ObjectiveFunctionType &function)
 
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 ()
 Empty virtual d'tor. More...
 
- Public Member Functions inherited from shark::INameable
virtual ~INameable ()
 
- Public Member Functions inherited from shark::ISerializable
virtual ~ISerializable ()
 Virtual d'tor. 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 ()
 

Protected Attributes

std::size_t m_numberOfVariables
 Stores the dimensionality of the search space. More...
 
std::size_t m_mu
 The size of the parent population. More...
 
std::size_t m_lambda
 The size of the offspring population, needs to be larger than mu. More...
 
double m_sigma
 The current step size. More...
 
double m_cSigma
 
double m_cC
 Constant for adapting the covariance matrix. More...
 
RealVector m_mean
 The current cog of the population. More...
 
shark::MultiVariateNormalDistribution m_mutationDistribution
 Multi-variate normal mutation distribution. 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
 

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...
 

Detailed Description

Implements the CMSA.

The algorithm is described in

H. G. Beyer, B. Sendhoff (2008). Covariance Matrix Adaptation Revisited: The CMSA Evolution Strategy In Proceedings of the Tenth International Conference on Parallel Problem Solving from Nature (PPSN X), pp. 123-132, LNCS, Springer-Verlag

Definition at line 64 of file CMSA.h.

Constructor & Destructor Documentation

Member Function Documentation

template<typename Container , typename Extractor >
RealVector shark::CMSA::cog ( const Container &  container,
const Extractor &  e 
)
inline

Calculates the center of gravity of the given population \( \in \mathbb{R}^d\).

Definition at line 96 of file CMSA.h.

References init(), m_mu, m_numberOfVariables, read(), SHARK_EXPORT_SYMBOL, step(), and write().

SHARK_EXPORT_SYMBOL void shark::CMSA::init ( ObjectiveFunctionType function,
SearchPointType const &  p 
)
virtual

Initializes the algorithm for the supplied objective function.

Implements shark::AbstractSingleObjectiveOptimizer< RealVector >.

Referenced by cog().

std::size_t shark::CMSA::lambda ( ) const
inline

Accesses the size of the offspring population.

Definition at line 137 of file CMSA.h.

References m_lambda.

std::size_t& shark::CMSA::lambda ( )
inline

Accesses the size of the offspring population, allows for l-value semantics.

Definition at line 144 of file CMSA.h.

References m_lambda.

std::size_t shark::CMSA::mu ( ) const
inline

Accesses the size of the parent population.

Definition at line 123 of file CMSA.h.

References m_mu.

std::size_t& shark::CMSA::mu ( )
inline

Accesses the size of the parent population, allows for l-value semantics.

Definition at line 130 of file CMSA.h.

References m_mu.

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

From INameable: return the class name.

Reimplemented from shark::INameable.

Definition at line 87 of file CMSA.h.

SHARK_EXPORT_SYMBOL void shark::CMSA::read ( InArchive archive)
virtual

Read the component from the supplied archive.

Parameters
[in,out]archiveThe archive to read from.

Reimplemented from shark::ISerializable.

Referenced by cog().

SHARK_EXPORT_SYMBOL void shark::CMSA::step ( ObjectiveFunctionType const &  function)
virtual

Executes one iteration of the algorithm.

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

Referenced by cog().

SHARK_EXPORT_SYMBOL void shark::CMSA::write ( OutArchive archive) const
virtual

Write the component to the supplied archive.

Parameters
[in,out]archiveThe archive to write to.

Reimplemented from shark::ISerializable.

Referenced by cog().

Member Data Documentation

double shark::CMSA::m_cC
protected

Constant for adapting the covariance matrix.

Definition at line 155 of file CMSA.h.

double shark::CMSA::m_cSigma
protected

Definition at line 154 of file CMSA.h.

std::size_t shark::CMSA::m_lambda
protected

The size of the offspring population, needs to be larger than mu.

Definition at line 151 of file CMSA.h.

Referenced by lambda().

RealVector shark::CMSA::m_mean
protected

The current cog of the population.

Definition at line 157 of file CMSA.h.

std::size_t shark::CMSA::m_mu
protected

The size of the parent population.

Definition at line 150 of file CMSA.h.

Referenced by cog(), and mu().

shark::MultiVariateNormalDistribution shark::CMSA::m_mutationDistribution
protected

Multi-variate normal mutation distribution.

Definition at line 159 of file CMSA.h.

std::size_t shark::CMSA::m_numberOfVariables
protected

Stores the dimensionality of the search space.

Definition at line 149 of file CMSA.h.

Referenced by cog().

double shark::CMSA::m_sigma
protected

The current step size.

Definition at line 153 of file CMSA.h.


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