#include <shark/Algorithms/DirectSearch/CMSA.h>
Public Member Functions | |
CMSA (random::rng_type &rng=random::globalRng) | |
Default c'tor. More... | |
std::string | name () const |
From INameable: return the class name. 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 const &function, SearchPointType const &p) |
Initializes the algorithm for the supplied objective function. More... | |
SHARK_EXPORT_SYMBOL void | init (ObjectiveFunctionType const &function, SearchPointType const &initialSearchPoint, std::size_t lambda, std::size_t mu, double initialSigma, const boost::optional< RealMatrix > &initialCovarianceMatrix=boost::optional< RealMatrix >()) |
Initializes the algorithm for the supplied objective function. More... | |
SHARK_EXPORT_SYMBOL void | step (ObjectiveFunctionType const &function) |
Executes one iteration of the algorithm. More... | |
void | setInitialSigma (double initSigma) |
sets the initial step length sigma More... | |
void | setMu (std::size_t mu) |
Sets the number of selected samples. More... | |
void | setLambda (std::size_t lambda) |
Sets the number of sampled points. More... | |
std::size_t | mu () const |
Accesses the size of the parent population. More... | |
std::size_t | lambda () const |
Accesses the size of the offspring population. More... | |
RealVector | eigenValues () const |
double | sigma () const |
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 SolutionType & | solution () const |
returns the current solution of the optimizer More... | |
Public Member Functions inherited from shark::AbstractOptimizer< RealVector, double, SingleObjectiveResultSet< RealVector > > | |
const Features & | features () 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... | |
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 Types | |
typedef Individual< RealVector, double, LightChromosome > | IndividualType |
The type of individual used by the CMSA. More... | |
Protected Member Functions | |
SHARK_EXPORT_SYMBOL std::vector< IndividualType > | generateOffspring () const |
Samples lambda individuals from the search distribution. More... | |
SHARK_EXPORT_SYMBOL void | updatePopulation (std::vector< IndividualType > const &offspring) |
Updates the strategy parameters based on the supplied offspring population. More... | |
SHARK_EXPORT_SYMBOL void | doInit (std::vector< SearchPointType > const &points, std::vector< ResultType > const &functionValues, std::size_t lambda, std::size_t mu, double initialSigma) |
Initializes the internal data structures of the CMSA. More... | |
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... | |
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
|
protected |
|
inline |
Default c'tor.
Definition at line 75 of file CMSA.h.
References shark::AbstractOptimizer< RealVector, double, SingleObjectiveResultSet< RealVector > >::m_features, and shark::AbstractOptimizer< RealVector, double, SingleObjectiveResultSet< RealVector > >::REQUIRES_VALUE.
|
protected |
Initializes the internal data structures of the CMSA.
|
inline |
Definition at line 139 of file CMSA.h.
References shark::sqr().
|
protected |
Samples lambda individuals from the search distribution.
|
virtual |
Initializes the algorithm for the supplied objective function.
Implements shark::AbstractSingleObjectiveOptimizer< RealVector >.
Referenced by name().
SHARK_EXPORT_SYMBOL void shark::CMSA::init | ( | ObjectiveFunctionType const & | function, |
SearchPointType const & | initialSearchPoint, | ||
std::size_t | lambda, | ||
std::size_t | mu, | ||
double | initialSigma, | ||
const boost::optional< RealMatrix > & | initialCovarianceMatrix = boost::optional< RealMatrix >() |
||
) |
Initializes the algorithm for the supplied objective function.
|
inline |
Accesses the size of the offspring population.
Definition at line 135 of file CMSA.h.
Referenced by name(), and setLambda().
|
inline |
|
inlinevirtual |
|
virtual |
Read the component from the supplied archive.
[in,out] | archive | The archive to read from. |
Reimplemented from shark::ISerializable.
Referenced by name().
|
inline |
|
inline |
|
inline |
|
virtual |
Executes one iteration of the algorithm.
Implements shark::AbstractOptimizer< RealVector, double, SingleObjectiveResultSet< RealVector > >.
Referenced by name().
|
protected |
Updates the strategy parameters based on the supplied offspring population.
|
virtual |
Write the component to the supplied archive.
[in,out] | archive | The archive to write to. |
Reimplemented from shark::ISerializable.
Referenced by name().