Implements the elitist CMA-ES. More...
#include <shark/Algorithms/DirectSearch/ElitistCMA.h>
Public Member Functions | |
SHARK_EXPORT_SYMBOL | ElitistCMA (random::rng_type &rng=random::globalRng) |
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 | step (ObjectiveFunctionType const &function) |
Executes one iteration of the algorithm. More... | |
bool | activeUpdate () const |
Returns true when the active update is used (default true). More... | |
bool & | activeUpdate () |
Setter function to enable active update. Returns true when the active update is used (default true). More... | |
double | constrainedPenaltyFactor () const |
Returns the penalty factor for an individual that is outside the feasible area. More... | |
double & | constrainedPenaltyFactor () |
Returns a reference to the penalty factor for an individual that is outside the feasible area. More... | |
double | sigma () const |
Returns the current step length. More... | |
double & | sigma () |
Returns the current step length. 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 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 () | |
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, ResultType > | ObjectiveFunctionType |
typedef TypedFlags< Feature > | Features |
typedef TypedFeatureNotAvailableException< Feature > | FeatureNotAvailableException |
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 |
Implements the elitist CMA-ES.
The algorithm is based on
C. Igel, T. Suttorp, and N. Hansen. A Computational Efficient Covariance Matrix Update and a (1+1)-CMA for Evolution Strategies. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO 2006), pp. 453-460, ACM Press, 2006
D. V. Arnold and N. Hansen: Active covariance matrix adaptation for the (1+1)-CMA-ES. In Proceedings of the Genetic and Evolutionary
Definition at line 69 of file ElitistCMA.h.
SHARK_EXPORT_SYMBOL shark::ElitistCMA::ElitistCMA | ( | random::rng_type & | rng = random::globalRng | ) |
|
inline |
Returns true when the active update is used (default true).
Definition at line 91 of file ElitistCMA.h.
|
inline |
Setter function to enable active update. Returns true when the active update is used (default true).
Definition at line 95 of file ElitistCMA.h.
|
inline |
Returns the penalty factor for an individual that is outside the feasible area.
The value is multiplied with the distance to the nearest feasible point.
Definition at line 102 of file ElitistCMA.h.
References shark::PenalizingEvaluator::m_penaltyFactor.
|
inline |
Returns a reference to the penalty factor for an individual that is outside the feasible area.
The value is multiplied with the distance to the nearest feasible point.
Definition at line 109 of file ElitistCMA.h.
References shark::PenalizingEvaluator::m_penaltyFactor.
|
virtual |
Initializes the algorithm for the supplied objective function.
Implements shark::AbstractSingleObjectiveOptimizer< RealVector >.
|
inlinevirtual |
From INameable: return the class name.
Reimplemented from shark::INameable.
Definition at line 75 of file ElitistCMA.h.
References init(), read(), SHARK_EXPORT_SYMBOL, step(), and write().
|
virtual |
Read the component from the supplied archive.
[in,out] | archive | The archive to read from. |
Reimplemented from shark::ISerializable.
Referenced by name().
|
inline |
Returns the current step length.
Definition at line 114 of file ElitistCMA.h.
References shark::Individual< PointType, FitnessTypeT, Chromosome >::chromosome(), and shark::CMAChromosome::m_stepSize.
Referenced by main().
|
inline |
Returns the current step length.
Definition at line 119 of file ElitistCMA.h.
References shark::Individual< PointType, FitnessTypeT, Chromosome >::chromosome(), and shark::CMAChromosome::m_stepSize.
|
virtual |
Executes one iteration of the algorithm.
Implements shark::AbstractOptimizer< RealVector, double, SingleObjectiveResultSet< RealVector > >.
|
virtual |
Write the component to the supplied archive.
[in,out] | archive | The archive to write to. |
Reimplemented from shark::ISerializable.
Referenced by name().