shark::VDCMA Class Reference

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

+ Inheritance diagram for shark::VDCMA:

Public Member Functions

 VDCMA (random::rng_type &rng=random::globalRng)
 Default c'tor.
 
std::string name () const
 From INameable: return the class name.
 
std::size_t suggestLambda (std::size_t dimension)
 Calculates lambda for the supplied dimensionality n.
 
std::size_t suggestMu (std::size_t lambda)
 Calculates mu for the supplied lambda and the recombination strategy.
 
void init (ObjectiveFunctionType const &function, SearchPointType const &p)
 initializes the optimizer using a predefined starting point
 
void init (ObjectiveFunctionType const &function, SearchPointType const &initialSearchPoint, std::size_t lambda, std::size_t mu, double initialSigma)
 Initializes the algorithm for the supplied objective function.
 
void step (ObjectiveFunctionType const &function)
 Executes one iteration of the algorithm.
 
double sigma () const
 Accesses the current step size.
 
void setSigma (double sigma)
 Accesses the current step size.
 
void setInitialSigma (double initialSigma)
 set the initial step size of the algorithm.
 
RealVector const & mean () const
 Accesses the current population mean.
 
RealVector const & weights () const
 Accesses the current weighting vector.
 
RealVector const & evolutionPath () const
 Accesses the evolution path for the covariance matrix update.
 
RealVector const & evolutionPathSigma () const
 Accesses the evolution path for the step size update.
 
std::size_t mu () const
 Returns the size of the parent population \(\mu\).
 
std::size_t & mu ()
 Returns a mutabl reference to the size of the parent population \(\mu\).
 
std::size_t lambda () const
 Returns a immutable reference to the size of the offspring population \(\mu\).
 
std::size_t & lambda ()
 Returns a mutable reference to the size of the offspring population \(\mu\).
 
- Public Member Functions inherited from shark::AbstractSingleObjectiveOptimizer< RealVector >
std::size_t numInitPoints () const
 By default most single objective optimizers only require a single point.
 
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.
 
virtual const SolutionTypesolution () const
 returns the current solution of the optimizer
 
- Public Member Functions inherited from shark::AbstractOptimizer< PointType, ResultT, SolutionTypeT >
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.
 
virtual void init (ObjectiveFunctionType const &function, std::vector< SearchPointType > const &initPoints)=0
 Initialize the optimizer for the supplied objective function using a set of initialisation points.
 
virtual void step (ObjectiveFunctionType const &function)=0
 Carry out one step of the optimizer for the supplied objective function.
 
- Public Member Functions inherited from shark::INameable
virtual ~INameable ()
 
- Public Member Functions inherited from shark::ISerializable
virtual ~ISerializable ()
 Virtual d'tor.
 
virtual void read (InArchive &archive)
 Read the component from the supplied archive.
 
virtual void write (OutArchive &archive) const
 Write the component to the supplied archive.
 
void load (InArchive &archive, unsigned int version)
 Versioned loading of components, calls read(...).
 
void save (OutArchive &archive, unsigned int version) const
 Versioned storing of components, calls write(...).
 
 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< PointType, ResultT, SolutionTypeT >
enum  Feature {
  REQUIRES_VALUE = 1 , REQUIRES_FIRST_DERIVATIVE = 2 , REQUIRES_SECOND_DERIVATIVE = 4 , CAN_SOLVE_CONSTRAINED = 8 ,
  REQUIRES_CLOSEST_FEASIBLE = 16
}
 Models features that the optimizer requires from the objective function. More...
 
typedef PointType SearchPointType
 
typedef ResultT ResultType
 
typedef SolutionTypeT SolutionType
 
typedef AbstractObjectiveFunction< PointType, ResultTypeObjectiveFunctionType
 
typedef TypedFlags< FeatureFeatures
 
typedef TypedFeatureNotAvailableException< FeatureFeatureNotAvailableException
 
- Protected Member Functions inherited from shark::AbstractOptimizer< PointType, ResultT, SolutionTypeT >
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.
 
- Protected Attributes inherited from shark::AbstractSingleObjectiveOptimizer< RealVector >
SolutionType m_best
 Current solution of the optimizer.
 
- Protected Attributes inherited from shark::AbstractOptimizer< PointType, ResultT, SolutionTypeT >
Features m_features
 

Detailed Description

Definition at line 52 of file VDCMA.h.

Constructor & Destructor Documentation

◆ VDCMA()

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

Member Function Documentation

◆ evolutionPath()

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

Accesses the evolution path for the covariance matrix update.

Definition at line 205 of file VDCMA.h.

◆ evolutionPathSigma()

RealVector const & shark::VDCMA::evolutionPathSigma ( ) const
inline

Accesses the evolution path for the step size update.

Definition at line 210 of file VDCMA.h.

◆ init() [1/2]

void shark::VDCMA::init ( ObjectiveFunctionType const &  function,
SearchPointType const &  initialSearchPoint,
std::size_t  lambda,
std::size_t  mu,
double  initialSigma 
)
inline

Initializes the algorithm for the supplied objective function.

Definition at line 99 of file VDCMA.h.

References lambda(), shark::AbstractSingleObjectiveOptimizer< RealVector >::m_best, mu(), shark::sqr(), and shark::random::uni().

◆ init() [2/2]

void shark::VDCMA::init ( ObjectiveFunctionType const &  function,
SearchPointType const &  startingPoint 
)
inlinevirtual

initializes the optimizer using a predefined starting point

Implements shark::AbstractSingleObjectiveOptimizer< RealVector >.

Definition at line 81 of file VDCMA.h.

References shark::AbstractOptimizer< PointType, ResultT, SolutionTypeT >::checkFeatures(), init(), lambda(), mu(), sigma(), suggestLambda(), and suggestMu().

Referenced by init().

◆ lambda() [1/2]

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

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

Definition at line 230 of file VDCMA.h.

◆ lambda() [2/2]

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

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

Definition at line 225 of file VDCMA.h.

Referenced by init(), init(), and suggestMu().

◆ mean()

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

Accesses the current population mean.

Definition at line 195 of file VDCMA.h.

◆ mu() [1/2]

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

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

Definition at line 220 of file VDCMA.h.

◆ mu() [2/2]

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

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

Definition at line 215 of file VDCMA.h.

Referenced by init(), and init().

◆ name()

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

From INameable: return the class name.

Reimplemented from shark::INameable.

Definition at line 66 of file VDCMA.h.

◆ setInitialSigma()

void shark::VDCMA::setInitialSigma ( double  initialSigma)
inline

set the initial step size of the algorithm.

Sets the initial sigma at init to a given value. If this is 0, which it is by default, the default initialisation will be sigma= 1/sqrt(N) where N is the number of variables to optimize.

this method is the prefered one instead of init()

Definition at line 189 of file VDCMA.h.

◆ setSigma()

void shark::VDCMA::setSigma ( double  sigma)
inline

Accesses the current step size.

Definition at line 178 of file VDCMA.h.

References sigma().

◆ sigma()

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

Accesses the current step size.

Definition at line 173 of file VDCMA.h.

Referenced by init(), and setSigma().

◆ step()

void shark::VDCMA::step ( ObjectiveFunctionType const &  function)
inline

Executes one iteration of the algorithm.

Definition at line 150 of file VDCMA.h.

References shark::AbstractSingleObjectiveOptimizer< RealVector >::m_best, and shark::searchPoint().

◆ suggestLambda()

std::size_t shark::VDCMA::suggestLambda ( std::size_t  dimension)
inline

Calculates lambda for the supplied dimensionality n.

Definition at line 70 of file VDCMA.h.

Referenced by init().

◆ suggestMu()

std::size_t shark::VDCMA::suggestMu ( std::size_t  lambda)
inline

Calculates mu for the supplied lambda and the recombination strategy.

Definition at line 75 of file VDCMA.h.

References lambda().

Referenced by init().

◆ weights()

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

Accesses the current weighting vector.

Definition at line 200 of file VDCMA.h.


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