ITK
5.2.0
Insight Toolkit
|
#include <itkAmoebaOptimizer.h>
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
virtual const char * | GetNameOfClass () const |
void | SetCostFunction (SingleValuedCostFunction *costFunction) override |
void | StartOptimization () override |
Public Member Functions inherited from itk::SingleValuedNonLinearVnlOptimizer | |
virtual const bool & | GetMaximize () const |
virtual void | SetMaximize (bool _arg) |
virtual void | MaximizeOn () |
virtual void | MaximizeOff () |
bool | GetMinimize () const |
void | SetMinimize (bool v) |
void | MinimizeOn () |
void | MinimizeOff () |
virtual const MeasureType & | GetCachedValue () const |
virtual const DerivativeType & | GetCachedDerivative () const |
virtual const ParametersType & | GetCachedCurrentPosition () const |
Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer | |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
virtual const CostFunctionType * | GetCostFunction () const |
virtual CostFunctionType * | GetModifiableCostFunction () |
MeasureType | GetValue (const ParametersType ¶meters) const |
virtual void | SetCostFunction (CostFunctionType *costFunction) |
Public Member Functions inherited from itk::Optimizer | |
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 |
virtual const ParametersType & | GetCurrentPosition () const |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *) |
unsigned long | AddObserver (const EventObject &event, Command *) 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) |
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 |
Wrap of the vnl_amoeba algorithm.
AmoebaOptimizer is a wrapper around the vnl_amoeba algorithm which is an implementation of the Nelder-Meade downhill simplex problem. For most problems, it is a few times slower than a Levenberg-Marquardt algorithm but does not require derivatives of its cost function. It works by creating a simplex (n+1 points in ND space). The cost function is evaluated at each corner of the simplex. The simplex is then modified (by reflecting a corner about the opposite edge, by shrinking the entire simplex, by contracting one edge of the simplex, or by expanding the simplex) in searching for the minimum of the cost function.
The methods AutomaticInitialSimplex() and SetInitialSimplexDelta() control whether the optimizer defines the initial simplex automatically (by constructing a very small simplex around the initial position) or uses a user supplied simplex size.
The method SetOptimizeWithRestarts() indicates that the amoeabe algorithm should be rerun after if converges. This heuristic increases the chances of escaping from a local optimum. Each time the simplex is initialized with the best solution obtained by the previous runs. The edge length is half of that from the previous iteration. The heuristic is terminated if the total number of iterations is greater-equal than the maximal number of iterations (SetMaximumNumberOfIterations) or the difference between the current function value and the best function value is less than a threshold (SetFunctionConvergenceTolerance) and max(|best_parameters_i - current_parameters_i|) is less than a threshold (SetParametersConvergenceTolerance).
Definition at line 66 of file itkAmoebaOptimizer.h.
using itk::AmoebaOptimizer::ConstPointer = SmartPointer<const Self> |
Definition at line 75 of file itkAmoebaOptimizer.h.
|
protected |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
Definition at line 171 of file itkAmoebaOptimizer.h.
using itk::AmoebaOptimizer::InternalParametersType = vnl_vector<double> |
InternalParameters type alias.
Definition at line 89 of file itkAmoebaOptimizer.h.
using itk::AmoebaOptimizer::NumberOfIterationsType = unsigned int |
Definition at line 76 of file itkAmoebaOptimizer.h.
using itk::AmoebaOptimizer::ParametersType = Superclass::ParametersType |
Parameters type. It defines a position in the optimization search space.
Definition at line 86 of file itkAmoebaOptimizer.h.
Definition at line 74 of file itkAmoebaOptimizer.h.
Standard "Self" type alias.
Definition at line 72 of file itkAmoebaOptimizer.h.
Definition at line 73 of file itkAmoebaOptimizer.h.
|
protected |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
overrideprotected |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
virtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
virtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
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 |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
virtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
virtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
virtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.
vnl_amoeba* itk::AmoebaOptimizer::GetOptimizer | ( | ) | const |
Method for getting access to the internal optimizer.
|
virtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
virtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
overridevirtual |
Report the reason for stopping.
Reimplemented from itk::Optimizer.
MeasureType itk::AmoebaOptimizer::GetValue | ( | ) | const |
Return Current Value
|
static |
Method for creation through the object factory.
|
virtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
virtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
overrideprotectedvirtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
Reimplemented from itk::Object.
|
virtual |
Set/Get the mode which determines how the amoeba algorithm defines the initial simplex. Default is AutomaticInitialSimplexOn. If AutomaticInitialSimplex is on, the initial simplex is created with a default size. If AutomaticInitialSimplex is off, then InitialSimplexDelta will be used to define the initial simplex, setting the ith corner of the simplex as [x0[0], x0[1], ..., x0[i]+InitialSimplexDelta[i], ..., x0[d-1]].
|
overridevirtual |
Plug in a Cost Function into the optimizer
Implements itk::SingleValuedNonLinearVnlOptimizer.
|
virtual |
The optimization algorithm will terminate when the simplex diameter and the difference in cost function values at the corners of the simplex falls below user specified thresholds. The cost function convergence threshold is set via SetFunctionConvergenceTolerance().
void itk::AmoebaOptimizer::SetInitialSimplexDelta | ( | ParametersType | initialSimplexDelta, |
bool | automaticInitialSimplex = false |
||
) |
Set/Get the deltas that are used to define the initial simplex when AutomaticInitialSimplex is off.
|
virtual |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
|
virtual |
Set/Get the mode that determines if we want to use multiple runs of the Amoeba optimizer. If true, then the optimizer is rerun after it converges. The additional runs are performed using a simplex initialized with the best solution obtained by the previous runs. The edge length is half of that from the previous iteration.
|
virtual |
The optimization algorithm will terminate when the simplex diameter and the difference in cost function values at the corners of the simplex falls below user specified thresholds. The simplex diameter threshold is set via SetParametersConvergenceTolerance().
|
overridevirtual |
Start optimization with an initial value.
Reimplemented from itk::Optimizer.
|
private |
Check that the settings are valid. If not throw an exception.
|
private |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
Definition at line 181 of file itkAmoebaOptimizer.h.
|
private |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
Definition at line 180 of file itkAmoebaOptimizer.h.
|
private |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
Definition at line 182 of file itkAmoebaOptimizer.h.
|
private |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
Definition at line 178 of file itkAmoebaOptimizer.h.
|
private |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
Definition at line 183 of file itkAmoebaOptimizer.h.
|
private |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
Definition at line 179 of file itkAmoebaOptimizer.h.
|
private |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
Definition at line 186 of file itkAmoebaOptimizer.h.
|
private |
Set/Get the maximum number of iterations. The optimization algorithm will terminate after the maximum number of iterations has been reached. The default value is defined as DEFAULT_MAXIMAL_NUMBER_OF_ITERATIONS.
Definition at line 184 of file itkAmoebaOptimizer.h.