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. | |
| void | updateAsParent (IndividualSuccess offspringSuccess) | 
| Updates a \((\mu+1)\)-MO-CMA-ES chromosome of a parent individual. | |
| template<typename Archive > | |
| void | serialize (Archive &archive, const unsigned int version) | 
| Serializes the CMAChromosometo the supplied archive. | |
| Public Attributes | |
| MultiVariateNormalDistributionCholesky | m_mutationDistribution | 
| Models the search distribution using a cholsky matrix. | |
| RealVector | m_evolutionPath | 
| Low-pass filtered accumulation of successful mutative steps. | |
| RealVector | m_lastStep | 
| The most recent mutative step. | |
| RealVector | m_lastZ | 
| The sample from N(0,I) that produced the last step. | |
| double | m_stepSize | 
| The step-size used to scale the normally-distributed mutative steps. Dynamically adapted during the run. | |
| double | m_stepSizeDampingFactor | 
| Damping factor \(d\) used in the step-size update procedure. | |
| double | m_stepSizeLearningRate | 
| The learning rate for the step-size. | |
| double | m_successProbability | 
| Current success probability of this parameter set. | |
| double | m_targetSuccessProbability | 
| Target success probability, close \( \frac{1}{5}\). | |
| double | m_evolutionPathLearningRate | 
| Learning rate (constant) for updating the evolution path. | |
| double | m_covarianceMatrixLearningRate | 
| Learning rate (constant) for updating the covariance matrix. | |
| double | m_covarianceMatrixUnlearningRate | 
| Learning rate (constant) for unlearning unsuccessful directions from the covariance matrix. | |
| double | m_successThreshold | 
| Success threshold \(p_{\text{thresh}}\) for cutting off evolution path updates. | |
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_covarianceMatrixLearningRate, m_covarianceMatrixUnlearningRate, m_evolutionPath, m_evolutionPathLearningRate, m_lastStep, m_lastZ, m_mutationDistribution, m_stepSizeDampingFactor, m_stepSizeLearningRate, m_successProbability, 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 m_covarianceMatrixLearningRate, m_covarianceMatrixUnlearningRate, m_evolutionPath, m_evolutionPathLearningRate, m_lastStep, m_mutationDistribution, m_stepSize, m_stepSizeDampingFactor, m_stepSizeLearningRate, m_successProbability, m_successThreshold, and m_targetSuccessProbability.
| 
 | 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_covarianceMatrixLearningRate, m_evolutionPath, m_evolutionPathLearningRate, m_lastStep, m_stepSize, m_stepSizeDampingFactor, m_stepSizeLearningRate, m_successProbability, m_successThreshold, and m_targetSuccessProbability.
Referenced by shark::CMAIndividual< FitnessType >::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_covarianceMatrixUnlearningRate, m_lastStep, m_lastZ, m_stepSize, m_stepSizeDampingFactor, m_stepSizeLearningRate, m_successProbability, m_successThreshold, m_targetSuccessProbability, and Successful.
Referenced by shark::CMAIndividual< FitnessType >::updateAsParent().
| double shark::CMAChromosome::m_covarianceMatrixLearningRate | 
Learning rate (constant) for updating the covariance matrix.
Definition at line 60 of file Chromosome.h.
Referenced by CMAChromosome(), serialize(), and updateAsOffspring().
| double shark::CMAChromosome::m_covarianceMatrixUnlearningRate | 
Learning rate (constant) for unlearning unsuccessful directions from the covariance matrix.
Definition at line 61 of file Chromosome.h.
Referenced by CMAChromosome(), serialize(), and updateAsParent().
| RealVector shark::CMAChromosome::m_evolutionPath | 
Low-pass filtered accumulation of successful mutative steps.
Definition at line 50 of file Chromosome.h.
Referenced by CMAChromosome(), serialize(), and updateAsOffspring().
| double shark::CMAChromosome::m_evolutionPathLearningRate | 
Learning rate (constant) for updating the evolution path.
Definition at line 59 of file Chromosome.h.
Referenced by CMAChromosome(), serialize(), and updateAsOffspring().
| RealVector shark::CMAChromosome::m_lastStep | 
The most recent mutative step.
Definition at line 51 of file Chromosome.h.
Referenced by CMAChromosome(), shark::CMAIndividual< FitnessType >::mutate(), serialize(), updateAsOffspring(), and updateAsParent().
| RealVector shark::CMAChromosome::m_lastZ | 
The sample from N(0,I) that produced the last step.
Definition at line 52 of file Chromosome.h.
Referenced by CMAChromosome(), and updateAsParent().
| MultiVariateNormalDistributionCholesky shark::CMAChromosome::m_mutationDistribution | 
Models the search distribution using a cholsky matrix.
Definition at line 48 of file Chromosome.h.
Referenced by CMAChromosome(), shark::CMAIndividual< FitnessType >::mutate(), and serialize().
| 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::CMAIndividual< FitnessType >::mutate(), serialize(), updateAsOffspring(), and updateAsParent().
| double shark::CMAChromosome::m_stepSizeDampingFactor | 
Damping factor \(d\) used in the step-size update procedure.
Definition at line 55 of file Chromosome.h.
Referenced by CMAChromosome(), serialize(), updateAsOffspring(), and updateAsParent().
| double shark::CMAChromosome::m_stepSizeLearningRate | 
The learning rate for the step-size.
Definition at line 56 of file Chromosome.h.
Referenced by CMAChromosome(), serialize(), updateAsOffspring(), and updateAsParent().
| double shark::CMAChromosome::m_successProbability | 
Current success probability of this parameter set.
Definition at line 57 of file Chromosome.h.
Referenced by CMAChromosome(), serialize(), updateAsOffspring(), and updateAsParent().
| double shark::CMAChromosome::m_successThreshold | 
Success threshold \(p_{\text{thresh}}\) for cutting off evolution path updates.
Definition at line 63 of file Chromosome.h.
Referenced by serialize(), updateAsOffspring(), and updateAsParent().
| double shark::CMAChromosome::m_targetSuccessProbability | 
Target success probability, close \( \frac{1}{5}\).
Definition at line 58 of file Chromosome.h.
Referenced by CMAChromosome(), serialize(), updateAsOffspring(), and updateAsParent().