ITK
6.0.0
Insight Toolkit
|
#include <itkOnePlusOneEvolutionaryOptimizer.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. "Parametric estimate of intensity inhomogeneities applied to MRI" Martin Styner, G. Gerig, Christian Brechbuehler, Gabor Szekely, IEEE TRANSACTIONS ON MEDICAL IMAGING; 19(3), pp. 153-165, 2000, (https://www.cs.unc.edu/~styner/docs/tmi00.pdf)
"Evaluation of 2D/3D bias correction with 1+1ES-optimization" Martin Styner, Prof. Dr. G. Gerig (IKT, BIWI, ETH Zuerich), TR-197 (https://www.cs.unc.edu/~styner/docs/StynerTR97.pdf)
Definition at line 71 of file itkOnePlusOneEvolutionaryOptimizer.h.
Public Member Functions | |
virtual const bool & | GetCatchGetValueException () const |
virtual const unsigned int & | GetCurrentIteration () const |
virtual const double & | GetFrobeniusNorm () const |
virtual const bool & | GetInitialized () const |
virtual const double & | GetMetricWorstPossibleValue () const |
bool | GetMinimize () const |
const char * | GetNameOfClass () const override |
std::string | GetStopConditionDescription () const override |
void | Initialize (double initialRadius, double grow=-1, double shrink=-1) |
void | MinimizeOff () |
void | MinimizeOn () |
virtual void | SetCatchGetValueException (bool _arg) |
virtual void | SetMetricWorstPossibleValue (double _arg) |
void | SetMinimize (bool v) |
void | SetNormalVariateGenerator (NormalVariateGeneratorType *generator) |
void | StartOptimization () override |
void | StopOptimization () |
virtual void | SetMaximize (bool _arg) |
virtual void | MaximizeOn () |
virtual const bool & | GetMaximize () const |
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 |
MeasureType | GetValue () const |
Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer | |
virtual CostFunctionType * | GetModifiableCostFunction () |
const char * | GetNameOfClass () const override |
MeasureType | GetValue (const ParametersType ¶meters) const |
virtual void | SetCostFunction (CostFunctionType *costFunction) |
Public Member Functions inherited from itk::Optimizer | |
virtual const ParametersType & | GetCurrentPosition () const |
virtual const ParametersType & | GetInitialPosition () const |
virtual void | SetInitialPosition (const ParametersType ¶m) |
void | SetScales (const ScalesType &scales) |
virtual const ScalesType & | GetScales () const |
virtual const ScalesType & | GetInverseScales () const |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
LightObject::Pointer | CreateAnother () const override |
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 |
Public Member Functions inherited from itk::LightObject | |
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 Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer | |
static Pointer | New () |
Static Public Member Functions inherited from itk::NonLinearOptimizer | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Optimizer | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Member Functions | |
OnePlusOneEvolutionaryOptimizer () | |
OnePlusOneEvolutionaryOptimizer (const OnePlusOneEvolutionaryOptimizer &) | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~OnePlusOneEvolutionaryOptimizer () override=default | |
Protected Member Functions inherited from itk::SingleValuedNonLinearOptimizer | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
SingleValuedNonLinearOptimizer () | |
~SingleValuedNonLinearOptimizer () override=default | |
Protected Member Functions inherited from itk::NonLinearOptimizer | |
NonLinearOptimizer ()=default | |
~NonLinearOptimizer () override | |
Protected Member Functions inherited from itk::Optimizer | |
Optimizer () | |
virtual void | SetCurrentPosition (const ParametersType ¶m) |
~Optimizer () override=default | |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
~Object () override | |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Private Attributes | |
bool | m_CatchGetValueException {} |
MeasureType | m_CurrentCost {} |
unsigned int | m_CurrentIteration {} |
double | m_Epsilon {} |
double | m_FrobeniusNorm {} |
double | m_GrowthFactor {} |
bool | m_Initialized {} |
double | m_InitialRadius {} |
bool | m_Maximize {} |
unsigned int | m_MaximumIteration {} |
double | m_MetricWorstPossibleValue {} |
NormalVariateGeneratorType::Pointer | m_RandomGenerator {} |
double | m_ShrinkFactor {} |
bool | m_Stop {} |
std::ostringstream | m_StopConditionDescription {} |
Additional Inherited Members | |
Protected Attributes inherited from itk::SingleValuedNonLinearOptimizer | |
CostFunctionPointer | m_CostFunction {} |
Protected Attributes inherited from itk::Optimizer | |
ParametersType | m_CurrentPosition {} |
bool | m_ScalesInitialized { false } |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount {} |
using itk::OnePlusOneEvolutionaryOptimizer::ConstPointer = SmartPointer<const Self> |
Definition at line 78 of file itkOnePlusOneEvolutionaryOptimizer.h.
Definition at line 88 of file itkOnePlusOneEvolutionaryOptimizer.h.
Type of the Cost Function
Definition at line 87 of file itkOnePlusOneEvolutionaryOptimizer.h.
using itk::OnePlusOneEvolutionaryOptimizer::NormalVariateGeneratorType = Statistics::RandomVariateGeneratorBase |
Normal random variate generator type.
Definition at line 91 of file itkOnePlusOneEvolutionaryOptimizer.h.
Definition at line 77 of file itkOnePlusOneEvolutionaryOptimizer.h.
Standard "Self" type alias.
Definition at line 75 of file itkOnePlusOneEvolutionaryOptimizer.h.
Definition at line 76 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
protected |
|
protected |
|
overrideprotecteddefault |
|
virtual |
|
virtual |
Return Current Value
|
virtual |
Return Current Iteration
|
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 if the Optimizer should Maximize the metric
|
virtual |
Set/Get maximum iteration limit.
|
virtual |
|
inline |
Definition at line 100 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
overridevirtual |
Reimplemented from itk::NonLinearOptimizer.
|
virtual |
Set/Get the search radius shrink factor.
|
overridevirtual |
Get the reason for termination
Reimplemented from itk::Optimizer.
|
inline |
Return Current Value
Definition at line 164 of file itkOnePlusOneEvolutionaryOptimizer.h.
void itk::OnePlusOneEvolutionaryOptimizer::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
|
virtual |
Set if the Optimizer should Maximize the metric
|
inline |
Definition at line 115 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
inline |
Definition at line 110 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
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::Object.
|
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 if the Optimizer should Maximize the metric
|
virtual |
Set/Get maximum iteration limit.
|
virtual |
|
inline |
Definition at line 105 of file itkOnePlusOneEvolutionaryOptimizer.h.
void itk::OnePlusOneEvolutionaryOptimizer::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::Optimizer.
|
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 186 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Definition at line 217 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Internal storage for the value type / used as a cache
Definition at line 240 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Current iteration
Definition at line 215 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
The minimal size of search radius (frobenius_norm of covariance matrix).
Definition at line 225 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Cache variable for reporting the Frobenius Norm
Definition at line 253 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Search radius growth factor in parameter space.
Definition at line 231 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Flag tells if the optimizer was initialized using Initialize function.
Definition at line 237 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Initial search radius in parameter space.
Definition at line 228 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Set if the Metric should be maximized: Default = False
Definition at line 221 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Maximum iteration limit.
Definition at line 212 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Definition at line 218 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Smart pointer to the normal random variate generator.
Definition at line 209 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Search radius shrink factor in parameter space,
Definition at line 234 of file itkOnePlusOneEvolutionaryOptimizer.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 246 of file itkOnePlusOneEvolutionaryOptimizer.h.
|
private |
Stop description
Definition at line 249 of file itkOnePlusOneEvolutionaryOptimizer.h.