shark::ElitistCMA Class Reference

Implements the elitist CMA-ES. More...

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

+ Inheritance diagram for shark::ElitistCMA:

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

Constructor & Destructor Documentation

◆ ElitistCMA()

SHARK_EXPORT_SYMBOL shark::ElitistCMA::ElitistCMA ( random::rng_type &  rng = random::globalRng)

Member Function Documentation

◆ activeUpdate() [1/2]

bool shark::ElitistCMA::activeUpdate ( ) const
inline

Returns true when the active update is used (default true).

Definition at line 91 of file ElitistCMA.h.

◆ activeUpdate() [2/2]

bool& shark::ElitistCMA::activeUpdate ( )
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.

◆ constrainedPenaltyFactor() [1/2]

double shark::ElitistCMA::constrainedPenaltyFactor ( ) const
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.

◆ constrainedPenaltyFactor() [2/2]

double& shark::ElitistCMA::constrainedPenaltyFactor ( )
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.

◆ init()

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

Initializes the algorithm for the supplied objective function.

Implements shark::AbstractSingleObjectiveOptimizer< RealVector >.

Referenced by main(), and name().

◆ name()

std::string shark::ElitistCMA::name ( ) const
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().

◆ read()

SHARK_EXPORT_SYMBOL void shark::ElitistCMA::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 name().

◆ sigma() [1/2]

double shark::ElitistCMA::sigma ( ) const
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().

◆ sigma() [2/2]

double& shark::ElitistCMA::sigma ( )
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.

◆ step()

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

Executes one iteration of the algorithm.

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

Referenced by main(), and name().

◆ write()

SHARK_EXPORT_SYMBOL void shark::ElitistCMA::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 name().


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