shark::PopulationBasedStepSizeAdaptation Class Reference

Step size adaptation based on the success of the new population compared to the old. More...

#include <shark/Algorithms/DirectSearch/Operators/PopulationBasedStepSizeAdaptation.h>

Public Member Functions

 PopulationBasedStepSizeAdaptation ()
 
double targetSuccessRate () const
 
double & targetSuccessRate ()
 
double learningRate () const
 
double & learningRate ()
 
double dampingFactor () const
 
double & dampingFactor ()
 
double stepSize () const
 
void init (double initialStepSize)
 Initializes a new trial by setting the initial learning rate and resetting the internal values. More...
 
template<class Population >
void update (Population const &offspring)
 updates the step size using the newly sampled population More...
 

Protected Attributes

double m_stepSize
 current value for the step size More...
 
RealVector m_prevFitness
 fitness values of the previous iteration for ranking More...
 
double m_s
 The time average of the population success. More...
 
double m_targetSuccessRate
 
double m_c
 
double m_d
 

Detailed Description

Step size adaptation based on the success of the new population compared to the old.

This is the step size adaptation algorithm as proposed in Ilya Loshchilov, "A Computationally Efficient Limited Memory CMA-ES for Large Scale Optimization"

It ranks the old and new population together and checks whether the mean rank of the new population is lower than the old one in this combined population. If this is true, the step size is increased in an exponential fashion. More formally, let \( r_t(i) \) be the rank of the i-th individual in the current population in the combined ranking and \( r_{t-1}(i) \) the rank of the i-th previous individual. Then we have

\[ z_t \leftarrow \frac 1 {\lamba^2} \sum_i^{\lambda} r_{t-1}(i) - r_t(i) - z*\]

where \( z* \) is a target success value, which defaults to 0.25 this statistic is stabilised using an exponential average:

\[ s_t \leftarrow (1-c)*s_{t-1} + c*z_t \]

where the learning rate c defaults to 0.3 finally we adapt the step size sigma by

\[ \sigma_t = \sigma_{t-1} exp(s_t/d) \]

where the damping factor d defaults to 1

Definition at line 53 of file PopulationBasedStepSizeAdaptation.h.

Constructor & Destructor Documentation

◆ PopulationBasedStepSizeAdaptation()

shark::PopulationBasedStepSizeAdaptation::PopulationBasedStepSizeAdaptation ( )
inline

Definition at line 55 of file PopulationBasedStepSizeAdaptation.h.

Member Function Documentation

◆ dampingFactor() [1/2]

double shark::PopulationBasedStepSizeAdaptation::dampingFactor ( ) const
inline

Definition at line 75 of file PopulationBasedStepSizeAdaptation.h.

References m_d.

◆ dampingFactor() [2/2]

double& shark::PopulationBasedStepSizeAdaptation::dampingFactor ( )
inline

Definition at line 79 of file PopulationBasedStepSizeAdaptation.h.

References m_d.

◆ init()

void shark::PopulationBasedStepSizeAdaptation::init ( double  initialStepSize)
inline

Initializes a new trial by setting the initial learning rate and resetting the internal values.

Definition at line 88 of file PopulationBasedStepSizeAdaptation.h.

References m_prevFitness, m_s, and m_stepSize.

◆ learningRate() [1/2]

double shark::PopulationBasedStepSizeAdaptation::learningRate ( ) const
inline

Definition at line 67 of file PopulationBasedStepSizeAdaptation.h.

References m_c.

◆ learningRate() [2/2]

double& shark::PopulationBasedStepSizeAdaptation::learningRate ( )
inline

Definition at line 71 of file PopulationBasedStepSizeAdaptation.h.

References m_c.

◆ stepSize()

double shark::PopulationBasedStepSizeAdaptation::stepSize ( ) const
inline

Definition at line 83 of file PopulationBasedStepSizeAdaptation.h.

References m_stepSize.

◆ targetSuccessRate() [1/2]

double shark::PopulationBasedStepSizeAdaptation::targetSuccessRate ( ) const
inline

Definition at line 59 of file PopulationBasedStepSizeAdaptation.h.

References m_targetSuccessRate.

◆ targetSuccessRate() [2/2]

double& shark::PopulationBasedStepSizeAdaptation::targetSuccessRate ( )
inline

Definition at line 63 of file PopulationBasedStepSizeAdaptation.h.

References m_targetSuccessRate.

◆ update()

template<class Population >
void shark::PopulationBasedStepSizeAdaptation::update ( Population const &  offspring)
inline

updates the step size using the newly sampled population

The offspring is assumed to be ordered in ascending order by their penalizedFitness (this is the same as ordering by the unpenalized fitness in an unconstrained setting)

Definition at line 99 of file PopulationBasedStepSizeAdaptation.h.

References lambda, m_c, m_d, m_prevFitness, m_s, m_stepSize, m_targetSuccessRate, and shark::penalizedFitness().

Member Data Documentation

◆ m_c

double shark::PopulationBasedStepSizeAdaptation::m_c
protected

Definition at line 148 of file PopulationBasedStepSizeAdaptation.h.

Referenced by learningRate(), and update().

◆ m_d

double shark::PopulationBasedStepSizeAdaptation::m_d
protected

Definition at line 149 of file PopulationBasedStepSizeAdaptation.h.

Referenced by dampingFactor(), and update().

◆ m_prevFitness

RealVector shark::PopulationBasedStepSizeAdaptation::m_prevFitness
protected

fitness values of the previous iteration for ranking

Definition at line 143 of file PopulationBasedStepSizeAdaptation.h.

Referenced by init(), and update().

◆ m_s

double shark::PopulationBasedStepSizeAdaptation::m_s
protected

The time average of the population success.

Definition at line 144 of file PopulationBasedStepSizeAdaptation.h.

Referenced by init(), and update().

◆ m_stepSize

double shark::PopulationBasedStepSizeAdaptation::m_stepSize
protected

current value for the step size

Definition at line 142 of file PopulationBasedStepSizeAdaptation.h.

Referenced by init(), stepSize(), and update().

◆ m_targetSuccessRate

double shark::PopulationBasedStepSizeAdaptation::m_targetSuccessRate
protected

Definition at line 147 of file PopulationBasedStepSizeAdaptation.h.

Referenced by targetSuccessRate(), and update().


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