#include <itkCMAEvolutionStrategyOptimizer.h>
A Covariance Matrix Adaptation Evolution Strategy Optimizer.
Based on the work by Hansen:
Definition at line 49 of file itkCMAEvolutionStrategyOptimizer.h.
Public Types | |
using | ConstPointer = SmartPointer<const Self> |
using | Pointer = SmartPointer<Self> |
using | ScaledCostFunctionType |
using | ScalesType |
using | Self = CMAEvolutionStrategyOptimizer |
enum | StopConditionType { MetricError , MaximumNumberOfIterations , PositionToleranceMin , PositionToleranceMax , ValueTolerance , ZeroStepLength , Unknown } |
using | Superclass = ScaledSingleValuedNonLinearOptimizer |
Public Types inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
using | ConstPointer = SmartPointer<const Self> |
using | Pointer = SmartPointer<Self> |
using | ScaledCostFunctionPointer = ScaledCostFunctionType::Pointer |
using | ScaledCostFunctionType = ScaledSingleValuedCostFunction |
using | ScalesType = NonLinearOptimizer::ScalesType |
using | Self = ScaledSingleValuedNonLinearOptimizer |
using | Superclass = SingleValuedNonLinearOptimizer |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
static Pointer | New () |
Protected Types | |
using | CovarianceMatrixType = vnl_matrix<double> |
using | EigenValueMatrixType = vnl_diag_matrix<double> |
using | MeasureContainerType = std::vector<MeasureIndexPairType> |
using | MeasureHistoryType = std::deque<MeasureType> |
using | MeasureIndexPairType = std::pair<MeasureType, unsigned int> |
using | ParameterContainerType = std::vector<ParametersType> |
using | RandomGeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator |
using | RecombinationWeightsType = Array<double> |
Protected Member Functions | |
virtual void | AdvanceOneStep () |
CMAEvolutionStrategyOptimizer () | |
virtual void | FixNumericalErrors () |
virtual void | GenerateOffspring () |
virtual void | InitializeBCD () |
virtual void | InitializeConstants () |
virtual void | InitializeProgressVariables () |
void | PrintSelf (std::ostream &os, Indent indent) const override |
virtual void | SortCostFunctionValues () |
virtual bool | TestConvergence (bool firstCheck) |
virtual void | UpdateBD () |
virtual void | UpdateC () |
virtual void | UpdateConjugateEvolutionPath () |
virtual void | UpdateEvolutionPath () |
virtual void | UpdateHeaviside () |
virtual void | UpdateSigma () |
~CMAEvolutionStrategyOptimizer () override=default | |
Protected Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
virtual void | GetScaledDerivative (const ParametersType ¶meters, DerivativeType &derivative) const |
virtual MeasureType | GetScaledValue (const ParametersType ¶meters) const |
virtual void | GetScaledValueAndDerivative (const ParametersType ¶meters, MeasureType &value, DerivativeType &derivative) const |
void | PrintSelf (std::ostream &os, Indent indent) const override |
ScaledSingleValuedNonLinearOptimizer () | |
void | SetCurrentPosition (const ParametersType ¶m) override |
virtual void | SetScaledCurrentPosition (const ParametersType ¶meters) |
~ScaledSingleValuedNonLinearOptimizer () override=default | |
Private Attributes | |
double | m_InitialSigma { 1.0 } |
double | m_MaximumDeviation { std::numeric_limits<double>::max() } |
unsigned long | m_MaximumNumberOfIterations { 100 } |
double | m_MinimumDeviation { 0.0 } |
double | m_PositionToleranceMax { 1e8 } |
double | m_PositionToleranceMin { 1e-12 } |
std::string | m_RecombinationWeightsPreset { "superlinear" } |
double | m_SigmaDecayA { 50 } |
double | m_SigmaDecayAlpha { 0.602 } |
bool | m_UseDecayingSigma { false } |
double | m_ValueTolerance { 1e-12 } |
using itk::CMAEvolutionStrategyOptimizer::ConstPointer = SmartPointer<const Self> |
Definition at line 57 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 230 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 229 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 235 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 232 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 234 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 231 of file itkCMAEvolutionStrategyOptimizer.h.
using itk::CMAEvolutionStrategyOptimizer::Pointer = SmartPointer<Self> |
Definition at line 56 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 237 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 228 of file itkCMAEvolutionStrategyOptimizer.h.
Definition at line 86 of file itkScaledSingleValuedNonLinearOptimizer.h.
Definition at line 85 of file itkScaledSingleValuedNonLinearOptimizer.h.
Definition at line 54 of file itkCMAEvolutionStrategyOptimizer.h.
Definition at line 55 of file itkCMAEvolutionStrategyOptimizer.h.
Enumerator | |
---|---|
MetricError | |
MaximumNumberOfIterations | |
PositionToleranceMin | |
PositionToleranceMax | |
ValueTolerance | |
ZeroStepLength | |
Unknown |
Definition at line 69 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Constructor
|
overrideprotecteddefault |
Destructor
|
protectedvirtual |
Compute the m_CurrentPosition = m(g+1), m_CurrentValue, and m_CurrentScaledStep
|
protectedvirtual |
Some checks, to be sure no numerical errors occur
|
protectedvirtual |
GenerateOffspring: Fill m_SearchDirs, m_NormalizedSearchDirs, and m_CostFunctionValues
|
virtual |
Reimplemented from itk::ScaledSingleValuedNonLinearOptimizer.
Reimplemented in elastix::CMAEvolutionStrategy< TElastix >.
|
virtual |
Get the current iteration number:
|
virtual |
The current maximum square root eigen value
|
virtual |
The current minimum square root eigen value
|
virtual |
Get the last step taken ( scaledPos_{k+1} - scaledPos_{k} ) If you want the step taken in the space of unscaled parameters, simply use: CMAESOptimizer->GetScaledCostFunction()->ConvertScaledToUnscaledParameters( ... ) To obtain the magnitude of the step, use ->GetCurretScaledStep().magnitude().
|
virtual |
The current value of sigma
|
inlinevirtual |
This function is just for convenience, since many optimizers have such a function. It return the current sigma times the current maximumD.
Definition at line 110 of file itkCMAEvolutionStrategyOptimizer.h.
|
virtual |
Get the metric value at the current position
|
virtual |
|
virtual |
|
virtual |
Setting: convergence condition: the maximum number of iterations. Default: 100
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Get the stop condition of the last run
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
protectedvirtual |
Initialize the covariance matrix and its eigen decomposition
|
protectedvirtual |
Compute the following constant variables:
|
protectedvirtual |
Initialize the following 'progress' variables:
Reimplemented in elastix::CMAEvolutionStrategy< TElastix >.
itk::CMAEvolutionStrategyOptimizer::ITK_DISALLOW_COPY_AND_MOVE | ( | CMAEvolutionStrategyOptimizer | ) |
|
static |
|
overrideprotected |
PrintSelf
|
virtual |
|
virtual |
Setting: the initial standard deviation used to generate offspring Recommended value: 1/3 * the expected range of the parameters Default: 1.0;
|
virtual |
Setting: the maximum deviation. It is ensured that: max_i( sigma*sqrt(C[i,i]) ) < MaximumDeviation Default: +infinity
|
virtual |
|
virtual |
Setting: the minimum deviation. It is ensured that: min_i( sigma*sqrt(C[i,i]) ) > MinimumDeviation Default: 0.0
|
virtual |
Setting: the number of parents (points for recombination, ) if set to 0, a default value is chosen: floor( populationSize / 2 ), which can be inspected after having started the optimisation. Default: 0
|
virtual |
Setting: the population size ( ); if set to 0, a default value is chosen: 4 + floor( 3 ln(NumberOfParameters) ), which can be inspected after having started the optimisation. Default: 0
|
virtual |
Setting: convergence condition: the maximum step size. 'convergence' is declared if: if ( sigma * sqrt(C[i,i]) > PositionToleranceMax*sigma0 for any i ) Default: 1e8
|
virtual |
Setting: convergence condition: the minimum step size. convergence is declared if: if ( sigma * max( abs(p_c[i]), sqrt(C[i,i]) ) < PositionToleranceMin*sigma0 for all i ) where p_c is the evolution path Default: 1e-12
|
virtual |
Setting: how the recombination weights are chosen: "equal", "linear" or "superlinear" are supported equal: weights = ones(mu,1); linear: weights = mu+1-(1:mu)'; superlinear: weights = log(mu+1)-log(1:mu)'; Default: "superlinear"
|
virtual |
Setting: the A parameter for the decaying sigma sequence. Default: 50
|
virtual |
Setting: the alpha parameter for the decaying sigma sequence. Default: 0.602
|
virtual |
Setting: the number of iterations after which B and D are updated. If 0: a default value is computed: floor( 1.0 / c_cov / Nd / 10.0 ) This value can be inspected after calling StartOptimization
|
virtual |
Setting: whether the covariance matrix adaptation scheme should be used. Default: true. If false: CovMatrix = Identity. This parameter may be changed by the optimiser, if it sees that the adaptation rate is nearly 0 (UpdateBDPeriod >= MaxNrOfIterations). This can be inspected calling StartOptimization()
|
virtual |
Setting: Use a sigma that decays according to a predefined function, instead of the adaptive scheme proposed by Hansen et al. if true: currentsigma(k+1) = currentsigma(k) * (A+k)^alpha / (A+k+1)^alpha where: k = the current iteration A, alpha = user-specified parameters (see below)
Default: false
|
virtual |
Setting: convergence condition: the minimum change of the cost function value over time. convergence is declared if: the range of the best cost function value measured over a period of M iterations was not greater than the valueTolerance, where: M = m_HistoryLength = min( maxnrofit, 10+ceil(3*10*N/lambda) ). Default: 1e-12
|
protectedvirtual |
Sort the m_CostFunctionValues vector and update m_MeasureHistory
|
override |
|
virtual |
|
protectedvirtual |
Check if convergence has occurred:
|
protectedvirtual |
Update the eigen decomposition and m_CurrentMaximumD/m_CurrentMinimumD
|
protectedvirtual |
Update the covariance matrix C
|
protectedvirtual |
Update m_ConjugateEvolutionPath
|
protectedvirtual |
Update m_EvolutionPath
|
protectedvirtual |
Update m_Heaviside
|
protectedvirtual |
Update the Sigma either by adaptation or using the predefined function
|
protected |
B: eigen vector matrix
Definition at line 314 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
C: covariance matrix
Definition at line 312 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 306 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 266 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
cost function values for each
Definition at line 298 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 270 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 274 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
The current iteration number
Definition at line 246 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
The current maximum square root eigen value:
Definition at line 288 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
The current minimum square root eigen value:
Definition at line 286 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 302 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 300 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
The current value of Sigma
Definition at line 283 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
The value of the cost function at the current position
Definition at line 243 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
D: sqrt(eigen values)
Definition at line 316 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Some other constants, without set/get methods These settings have default values.
Definition at line 264 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 304 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 272 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 276 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 291 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Length of the MeasureHistory deque
Definition at line 280 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Definition at line 430 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Definition at line 434 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Settings that are only inspected/changed by the associated get/set member functions.
Definition at line 428 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
History of best measure values
Definition at line 309 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Definition at line 435 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
realisations of
Definition at line 296 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 257 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 256 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Definition at line 436 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Definition at line 437 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
The random number generator used to generate the offspring.
Definition at line 240 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
array of
Definition at line 278 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Definition at line 433 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 294 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 268 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Definition at line 431 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Definition at line 432 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Boolean that indicates whether the optimizer should stop
Definition at line 252 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
The stop condition
Definition at line 249 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Definition at line 258 of file itkCMAEvolutionStrategyOptimizer.h.
|
protected |
Settings that may be changed by the optimizer:
Definition at line 255 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Definition at line 429 of file itkCMAEvolutionStrategyOptimizer.h.
|
private |
Definition at line 438 of file itkCMAEvolutionStrategyOptimizer.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |