#include <itkOnePlusOneEvolutionaryOptimizerv4.h>
1+1 evolutionary strategy optimizer
This optimizer searches for the optimal parameters. It changes its search radius and position using the grow factor ,shrink factor, and isotropic probability function (which is a random unit normal variate generator).
This optimizer needs a cost function and a random unit normal variate generator. The cost function should return cost with new position in parameter space which will be generated by 1+1 evolutionary strategy. Users should plug-in the random unit normal variate generator using SetNormalVariateGenerator method.
The SetEpsilon method is the minimum value for the frobenius_norm of the covariance matrix. If the fnorm is smaller than this value, the optimization process will stop even before it hits the maximum iteration.
Another way to stop the optimization process is calling the StopOptimization method. At next iteration after calling it, the optimization process will stop.
This optimizing scheme was initially developed and implemented by Martin Styner, Univ. of North Carolina at Chapel Hill, and his colleagues.
For more details refer to the following articles [113] and [112].
Definition at line 63 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
Public Member Functions | |
virtual void | CatchGetValueExceptionOff () |
virtual void | CatchGetValueExceptionOn () |
virtual::itk::LightObject::Pointer | CreateAnother () const |
virtual const bool & | GetCatchGetValueException () const |
virtual const double & | GetFrobeniusNorm () const |
virtual const bool & | GetInitialized () const |
virtual const double & | GetMetricWorstPossibleValue () const |
const char * | GetNameOfClass () const override |
std::string | GetStopConditionDescription () const override |
void | Initialize (double initialRadius, double grow=-1, double shrink=-1) |
virtual void | SetCatchGetValueException (bool _arg) |
virtual void | SetMetricWorstPossibleValue (double _arg) |
void | SetNormalVariateGenerator (NormalVariateGeneratorType *generator) |
void | StartOptimization (bool doOnlyInitialization=false) override |
void | StopOptimization () |
virtual void | SetMaximumIteration (unsigned int _arg) |
virtual const unsigned int & | GetMaximumIteration () const |
virtual void | SetGrowthFactor (double _arg) |
virtual const double & | GetGrowthFactor () const |
virtual void | SetShrinkFactor (double _arg) |
virtual const double & | GetShrinkFactor () const |
virtual void | SetInitialRadius (double _arg) |
virtual const double & | GetInitialRadius () const |
virtual void | SetEpsilon (double _arg) |
virtual const double & | GetEpsilon () const |
virtual const MeasureType & | GetCurrentCost () const |
const MeasureType & | GetValue () const override |
![]() | |
virtual bool | CanUseScales () const |
virtual bool | CanUseScales () const |
virtual SizeValueType | GetCurrentIteration () const |
virtual SizeValueType | GetCurrentIteration () const |
virtual const MeasureType & | GetCurrentMetricValue () const |
virtual const MeasureType & | GetCurrentMetricValue () const |
virtual const ParametersType & | GetCurrentPosition () const |
virtual const ParametersType & | GetCurrentPosition () const |
virtual SizeValueType | GetNumberOfIterations () const |
virtual SizeValueType | GetNumberOfIterations () const |
virtual const ThreadIdType & | GetNumberOfWorkUnits () const |
virtual const ThreadIdType & | GetNumberOfWorkUnits () const |
virtual const ScalesType & | GetScales () const |
virtual const ScalesType & | GetScales () const |
virtual const bool & | GetScalesAreIdentity () const |
virtual const bool & | GetScalesAreIdentity () const |
bool | GetScalesInitialized () const |
bool | GetScalesInitialized () const |
virtual const ScalesType & | GetWeights () const |
virtual const ScalesType & | GetWeights () const |
virtual const bool & | GetWeightsAreIdentity () const |
virtual const bool & | GetWeightsAreIdentity () const |
virtual void | SetNumberOfIterations (SizeValueType _arg) |
virtual void | SetNumberOfIterations (SizeValueType _arg) |
virtual void | SetNumberOfWorkUnits (ThreadIdType number) |
virtual void | SetNumberOfWorkUnits (ThreadIdType number) |
virtual void | SetScalesEstimator (ScalesEstimatorType *_arg) |
virtual void | SetScalesEstimator (ScalesEstimatorType *_arg) |
virtual void | SetWeights (ScalesType _arg) |
virtual void | SetWeights (ScalesType _arg) |
virtual void | SetMetric (MetricType *_arg) |
virtual MetricType * | GetModifiableMetric () |
virtual const MetricType * | GetMetric () const |
virtual void | SetMetric (MetricType *_arg) |
virtual MetricType * | GetModifiableMetric () |
virtual const MetricType * | GetMetric () const |
virtual void | SetScales (const ScalesType &scales) |
virtual void | SetScales (const ScalesType &scales) |
virtual void | SetDoEstimateScales (bool _arg) |
virtual const bool & | GetDoEstimateScales () const |
virtual void | DoEstimateScalesOn () |
virtual void | DoEstimateScalesOff () |
virtual void | SetDoEstimateScales (bool _arg) |
virtual const bool & | GetDoEstimateScales () const |
virtual void | DoEstimateScalesOn () |
virtual void | DoEstimateScalesOff () |
![]() | |
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) const |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
![]() | |
Pointer | Clone () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
static Pointer | New () |
![]() | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
![]() | |
static void | BreakOnError () |
static Pointer | New () |
Private Attributes | |
bool | m_CatchGetValueException {} |
MeasureType | m_CurrentCost {} |
double | m_Epsilon {} |
double | m_FrobeniusNorm {} |
double | m_GrowthFactor {} |
bool | m_Initialized {} |
double | m_InitialRadius {} |
unsigned int | m_MaximumIteration {} |
double | m_MetricWorstPossibleValue {} |
NormalVariateGeneratorType::Pointer | m_RandomGenerator {} |
double | m_ShrinkFactor {} |
bool | m_Stop {} |
std::ostringstream | m_StopConditionDescription {} |
Additional Inherited Members | |
![]() | |
SizeValueType | m_CurrentIteration |
SizeValueType | m_CurrentIteration |
MeasureType | m_CurrentMetricValue |
MeasureType | m_CurrentMetricValue |
bool | m_DoEstimateScales |
bool | m_DoEstimateScales |
MetricTypePointer | m_Metric |
MetricTypePointer | m_Metric |
SizeValueType | m_NumberOfIterations |
SizeValueType | m_NumberOfIterations |
ThreadIdType | m_NumberOfWorkUnits |
ThreadIdType | m_NumberOfWorkUnits |
ScalesType | m_Scales |
ScalesType | m_Scales |
bool | m_ScalesAreIdentity |
bool | m_ScalesAreIdentity |
ScalesEstimatorType::Pointer | m_ScalesEstimator |
ScalesEstimatorType::Pointer | m_ScalesEstimator |
ScalesType | m_Weights |
ScalesType | m_Weights |
bool | m_WeightsAreIdentity |
bool | m_WeightsAreIdentity |
![]() | |
std::atomic< int > | m_ReferenceCount {} |
using itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >::ConstPointer = SmartPointer<const Self> |
Definition at line 71 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
using itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >::CostFunctionPointer = CostFunctionType::Pointer |
Definition at line 81 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
using itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >::CostFunctionType = SingleValuedCostFunctionv4 |
Type of the Cost Function
Definition at line 80 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::MeasureType |
Measure type
Definition at line 145 of file itkObjectToObjectOptimizerBase.h.
using itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >::NormalVariateGeneratorType = Statistics::RandomVariateGeneratorBase |
Normal random variate generator type.
Definition at line 84 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::ParametersType |
Parameters type.
Definition at line 132 of file itkObjectToObjectOptimizerBase.h.
using itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >::Pointer = SmartPointer<Self> |
Definition at line 70 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::ScalesType |
Scale type.
Definition at line 128 of file itkObjectToObjectOptimizerBase.h.
using itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >::Self = OnePlusOneEvolutionaryOptimizerv4 |
Standard "Self" type alias.
Definition at line 68 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
using itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >::Superclass = ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType> |
Definition at line 69 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
protected |
Referenced by GetNameOfClass(), and OnePlusOneEvolutionaryOptimizerv4().
|
protected |
References OnePlusOneEvolutionaryOptimizerv4().
|
overrideprotecteddefault |
|
virtual |
|
virtual |
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
|
virtual |
|
virtual |
Return Current Value
|
virtual |
Set/Get the minimal size of search radius (frobenius_norm of covariance matrix).
|
virtual |
Get the current Frobenius norm of covariance matrix
|
virtual |
Set/Get the search radius grow factor in parameter space.
|
virtual |
Return if optimizer has been initialized
|
virtual |
Set/Get initial search radius in parameter space
|
virtual |
Set/Get maximum iteration limit.
|
virtual |
|
overridevirtual |
Reimplemented from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >.
References OnePlusOneEvolutionaryOptimizerv4().
|
virtual |
Set/Get the search radius shrink factor.
|
overridevirtual |
Stop condition return string type
Implements itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >.
|
overridevirtual |
Return Current Value
Reimplemented from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >.
void itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >::Initialize | ( | double | initialRadius, |
double | grow = -1, | ||
double | shrink = -1 ) |
Initializes the optimizer. Before running this optimizer, this function should have been called.
initialRadius: search radius in parameter space grow: search radius grow factor shrink: search radius shrink factor
|
static |
Method for creation through the object factory.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >.
|
virtual |
|
virtual |
Set/Get the minimal size of search radius (frobenius_norm of covariance matrix).
|
virtual |
Set/Get the search radius grow factor in parameter space.
|
virtual |
Set/Get initial search radius in parameter space
|
virtual |
Set/Get maximum iteration limit.
|
virtual |
void itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >::SetNormalVariateGenerator | ( | NormalVariateGeneratorType * | generator | ) |
|
virtual |
Set/Get the search radius shrink factor.
|
overridevirtual |
Start optimization. Optimization will stop when it meets either of two termination conditions, the maximum iteration limit or epsilon (minimal search radius)
Reimplemented from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >.
|
inline |
when users call StartOptimization, this value will be set false. By calling StopOptimization, this flag will be set true, and optimization will stop at the next iteration.
Definition at line 155 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
References m_Stop.
|
private |
Definition at line 184 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
Internal storage for the value type / used as a cache
Definition at line 204 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
The minimal size of search radius (frobenius_norm of covariance matrix).
Definition at line 189 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
Cache variable for reporting the Frobenius Norm
Definition at line 217 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
Search radius growth factor in parameter space.
Definition at line 195 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
Flag tells if the optimizer was initialized using Initialize function.
Definition at line 201 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
Initial search radius in parameter space.
Definition at line 192 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
Maximum iteration limit.
Definition at line 182 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
Definition at line 185 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
Smart pointer to the normal random variate generator.
Definition at line 179 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
Search radius shrink factor in parameter space,
Definition at line 198 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
|
private |
This is user-settable flag to stop optimization. when users call StartOptimization, this value will be set false. By calling StopOptimization, this flag will be set true, and optimization will stop at the next iteration.
Definition at line 210 of file itkOnePlusOneEvolutionaryOptimizerv4.h.
Referenced by StopOptimization().
|
private |
Stop description
Definition at line 213 of file itkOnePlusOneEvolutionaryOptimizerv4.h.