Models a CMAChromosomeof the elitist (MO-)CMA-ES that encodes strategy parameters. More...
#include <shark/Algorithms/DirectSearch/CMA/Chromosome.h>
Public Types | |
enum | IndividualSuccess { Successful = 1, Unsuccessful = 2, Failure = 3 } |
Public Member Functions | |
CMAChromosome () | |
CMAChromosome (std::size_t searchSpaceDimension, double successThreshold, double initialStepSize) | |
void | updateAsOffspring () |
Updates a \((\mu+1)\)-MO-CMA-ES chromosome of an successful offspring individual. It is assumed that unsuccessful individuals are not selected for future mutation. More... | |
void | updateAsParent (IndividualSuccess offspringSuccess) |
Updates a \((\mu+1)\)-MO-CMA-ES chromosome of a parent individual. More... | |
template<typename Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Serializes the CMAChromosometo the supplied archive. More... | |
Public Attributes | |
MultiVariateNormalDistributionCholesky | m_mutationDistribution |
Models the search distribution using a cholsky matrix. More... | |
RealVector | m_evolutionPath |
Low-pass filtered accumulation of successful mutative steps. More... | |
RealVector | m_lastStep |
The most recent mutative step. More... | |
RealVector | m_lastZ |
The sample from N(0,I) that produced the last step. More... | |
double | m_stepSize |
The step-size used to scale the normally-distributed mutative steps. Dynamically adapted during the run. More... | |
double | m_stepSizeDampingFactor |
Damping factor \(d\) used in the step-size update procedure. More... | |
double | m_stepSizeLearningRate |
The learning rate for the step-size. More... | |
double | m_successProbability |
Current success probability of this parameter set. More... | |
double | m_targetSuccessProbability |
Target success probability, close \( \frac{1}{5}\). More... | |
double | m_evolutionPathLearningRate |
Learning rate (constant) for updating the evolution path. More... | |
double | m_covarianceMatrixLearningRate |
Learning rate (constant) for updating the covariance matrix. More... | |
double | m_covarianceMatrixUnlearningRate |
Learning rate (constant) for unlearning unsuccessful directions from the covariance matrix. More... | |
double | m_successThreshold |
Success threshold \(p_{\text{thresh}}\) for cutting off evolution path updates. More... | |
Models a CMAChromosomeof the elitist (MO-)CMA-ES that encodes strategy parameters.
Definition at line 42 of file Chromosome.h.
Enumerator | |
---|---|
Successful | |
Unsuccessful | |
Failure |
Definition at line 43 of file Chromosome.h.
|
inline |
Definition at line 65 of file Chromosome.h.
|
inline |
Definition at line 66 of file Chromosome.h.
References m_targetSuccessProbability, shark::MultiVariateNormalDistributionCholesky::resize(), and shark::sqr().
|
inline |
Serializes the CMAChromosometo the supplied archive.
Archive | The type of the archive the CMAChromosomeshall be serialized to. |
[in,out] | archive | The archive to serialize to. |
[in] | version | Version information (optional and not used here). |
Definition at line 151 of file Chromosome.h.
References beta, m_evolutionPathLearningRate, and shark::MultiVariateNormalDistributionCholesky::rankOneUpdate().
|
inline |
Updates a \((\mu+1)\)-MO-CMA-ES chromosome of an successful offspring individual. It is assumed that unsuccessful individuals are not selected for future mutation.
Updates strategy parameters according to:
\begin{align*} \bar{p}_{\text{succ}} & \leftarrow & (1-c_p)\bar{p}_{\text{succ}} + c_p \\ \sigma & \leftarrow & \sigma \cdot e^{\frac{1}{d}\frac{\bar{p}_{\text{succ}} - p^{\text{target}}_{\text{succ}}}{1-p^{\text{target}}_{\text{succ}}}}\\ \vec{p}_c & \leftarrow & (1-c_c) \vec{p}_c + \mathbb{1}_{\bar{p}_{\text{succ}} < p_{\text{thresh}}} \sqrt{c_c (2 - c_c)} \vec{x}_{\text{step}} \\ \vec{C} & \leftarrow & (1-c_{\text{cov}}) \vec{C} + c_{\text{cov}} \left( \vec{p}_c \vec{p}_c^T + \mathbb{1}_{\bar{p}_{\text{succ}} \geq p_{\text{thresh}}} c_c (2 - c_c) \vec{C} \right) \end{align*}
Definition at line 100 of file Chromosome.h.
References m_evolutionPathLearningRate, and m_stepSizeLearningRate.
Referenced by shark::CMAIndividual< double >::updateAsOffspring().
|
inline |
Updates a \((\mu+1)\)-MO-CMA-ES chromosome of a parent individual.
This is called when the parent individual survived the last selection process. The update process depends now on how the offspring fares: It can be successful, unsuccesful or a complete failure.
Based on whether it is succesful or not, the global stepsize is adapted as for the child. In the case of a failure the direction of that individual is actively purged from the Covariance matrix to make this offspring less likely.
Definition at line 123 of file Chromosome.h.
References Failure, m_stepSizeLearningRate, and Successful.
Referenced by shark::CMAIndividual< double >::updateAsParent().
double shark::CMAChromosome::m_covarianceMatrixLearningRate |
Learning rate (constant) for updating the covariance matrix.
Definition at line 60 of file Chromosome.h.
double shark::CMAChromosome::m_covarianceMatrixUnlearningRate |
Learning rate (constant) for unlearning unsuccessful directions from the covariance matrix.
Definition at line 61 of file Chromosome.h.
RealVector shark::CMAChromosome::m_evolutionPath |
Low-pass filtered accumulation of successful mutative steps.
Definition at line 50 of file Chromosome.h.
double shark::CMAChromosome::m_evolutionPathLearningRate |
Learning rate (constant) for updating the evolution path.
Definition at line 59 of file Chromosome.h.
Referenced by serialize(), and updateAsOffspring().
RealVector shark::CMAChromosome::m_lastStep |
The most recent mutative step.
Definition at line 51 of file Chromosome.h.
RealVector shark::CMAChromosome::m_lastZ |
The sample from N(0,I) that produced the last step.
Definition at line 52 of file Chromosome.h.
MultiVariateNormalDistributionCholesky shark::CMAChromosome::m_mutationDistribution |
Models the search distribution using a cholsky matrix.
Definition at line 48 of file Chromosome.h.
Referenced by shark::CMAIndividual< double >::mutate().
double shark::CMAChromosome::m_stepSize |
The step-size used to scale the normally-distributed mutative steps. Dynamically adapted during the run.
Definition at line 54 of file Chromosome.h.
Referenced by shark::ElitistCMA::sigma().
double shark::CMAChromosome::m_stepSizeDampingFactor |
Damping factor \(d\) used in the step-size update procedure.
Definition at line 55 of file Chromosome.h.
double shark::CMAChromosome::m_stepSizeLearningRate |
The learning rate for the step-size.
Definition at line 56 of file Chromosome.h.
Referenced by updateAsOffspring(), and updateAsParent().
double shark::CMAChromosome::m_successProbability |
Current success probability of this parameter set.
Definition at line 57 of file Chromosome.h.
double shark::CMAChromosome::m_successThreshold |
Success threshold \(p_{\text{thresh}}\) for cutting off evolution path updates.
Definition at line 63 of file Chromosome.h.
double shark::CMAChromosome::m_targetSuccessProbability |
Target success probability, close \( \frac{1}{5}\).
Definition at line 58 of file Chromosome.h.
Referenced by CMAChromosome().