ITK  4.1.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Private Attributes
itk::AmoebaOptimizer Class Reference

#include <itkAmoebaOptimizer.h>

+ Inheritance diagram for itk::AmoebaOptimizer:
+ Collaboration diagram for itk::AmoebaOptimizer:

List of all members.

Public Types

typedef SmartPointer< const SelfConstPointer
typedef vnl_vector< double > InternalParametersType
typedef unsigned int NumberOfIterationsType
typedef Superclass::ParametersType ParametersType
typedef SmartPointer< SelfPointer
typedef AmoebaOptimizer Self
typedef
SingleValuedNonLinearVnlOptimizer 
Superclass

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
virtual const char * GetNameOfClass () const
vnl_amoeba * GetOptimizer (void) const
const std::string GetStopConditionDescription () const
MeasureType GetValue () const
virtual void SetCostFunction (SingleValuedCostFunction *costFunction)
void StartOptimization (void)
virtual void SetMaximumNumberOfIterations (NumberOfIterationsType _arg)
virtual NumberOfIterationsType GetMaximumNumberOfIterations () const
virtual void SetAutomaticInitialSimplex (bool _arg)
virtual void AutomaticInitialSimplexOn ()
virtual void AutomaticInitialSimplexOff ()
virtual bool GetAutomaticInitialSimplex () const
virtual void SetOptimizeWithRestarts (bool _arg)
virtual void OptimizeWithRestartsOn ()
virtual void OptimizeWithRestartsOff ()
virtual bool GetOptimizeWithRestarts () const
void SetInitialSimplexDelta (ParametersType initialSimplexDelta, bool automaticInitialSimplex=false)
virtual ParametersType GetInitialSimplexDelta () const
virtual void SetParametersConvergenceTolerance (double _arg)
virtual double GetParametersConvergenceTolerance () const
virtual void SetFunctionConvergenceTolerance (double _arg)
virtual double GetFunctionConvergenceTolerance () const

Static Public Member Functions

static Pointer New ()

Protected Types

typedef
Superclass::CostFunctionAdaptorType 
CostFunctionAdaptorType

Protected Member Functions

 AmoebaOptimizer ()
void PrintSelf (std::ostream &os, Indent indent) const
virtual ~AmoebaOptimizer ()

Private Member Functions

void ValidateSettings ()
 AmoebaOptimizer (const Self &)
void operator= (const Self &)

Private Attributes

bool m_AutomaticInitialSimplex
CostFunctionType::MeasureType m_FunctionConvergenceTolerance
ParametersType m_InitialSimplexDelta
NumberOfIterationsType m_MaximumNumberOfIterations
bool m_OptimizeWithRestarts
ParametersType::ValueType m_ParametersConvergenceTolerance
std::ostringstream m_StopConditionDescription
vnl_amoeba * m_VnlOptimizer

Detailed Description

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 61 of file itkAmoebaOptimizer.h.


Member Typedef Documentation

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

Definition at line 69 of file itkAmoebaOptimizer.h.

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

Definition at line 159 of file itkAmoebaOptimizer.h.

InternalParameters typedef.

Definition at line 83 of file itkAmoebaOptimizer.h.

Definition at line 70 of file itkAmoebaOptimizer.h.

Parameters type. It defines a position in the optimization search space.

Reimplemented from itk::SingleValuedNonLinearOptimizer.

Definition at line 76 of file itkAmoebaOptimizer.h.

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

Definition at line 68 of file itkAmoebaOptimizer.h.

Standard "Self" typedef.

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

Definition at line 66 of file itkAmoebaOptimizer.h.

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

Definition at line 67 of file itkAmoebaOptimizer.h.


Constructor & Destructor Documentation

virtual itk::AmoebaOptimizer::~AmoebaOptimizer ( ) [protected, virtual]

Check that the settings are valid. If not throw an exception.


Member Function Documentation

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]].

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]].

virtual::itk::LightObject::Pointer itk::AmoebaOptimizer::CreateAnother ( void  ) const [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::SingleValuedNonLinearOptimizer.

virtual bool itk::AmoebaOptimizer::GetAutomaticInitialSimplex ( ) const [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]].

virtual double itk::AmoebaOptimizer::GetFunctionConvergenceTolerance ( ) const [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().

Set/Get the deltas that are used to define the initial simplex when AutomaticInitialSimplex is off.

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 const char* itk::AmoebaOptimizer::GetNameOfClass ( ) const [virtual]

Run-time type information (and related methods).

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

vnl_amoeba* itk::AmoebaOptimizer::GetOptimizer ( void  ) const

Method for getting access to the internal optimizer.

virtual bool itk::AmoebaOptimizer::GetOptimizeWithRestarts ( ) const [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 double itk::AmoebaOptimizer::GetParametersConvergenceTolerance ( ) const [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().

const std::string itk::AmoebaOptimizer::GetStopConditionDescription ( ) const [virtual]

Report the reason for stopping.

Reimplemented from itk::Optimizer.

Return Current Value

static Pointer itk::AmoebaOptimizer::New ( ) [static]

Method for creation through the object factory.

Reimplemented from itk::SingleValuedNonLinearOptimizer.

void itk::AmoebaOptimizer::operator= ( const Self ) [private]

Check that the settings are valid. If not throw an exception.

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

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.

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.

void itk::AmoebaOptimizer::PrintSelf ( std::ostream &  os,
Indent  indent 
) const [protected, virtual]

Print out internal state

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

virtual void itk::AmoebaOptimizer::SetAutomaticInitialSimplex ( bool  _arg) [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]].

virtual void itk::AmoebaOptimizer::SetCostFunction ( SingleValuedCostFunction costFunction) [virtual]

Plug in a Cost Function into the optimizer

Implements itk::SingleValuedNonLinearVnlOptimizer.

virtual void itk::AmoebaOptimizer::SetFunctionConvergenceTolerance ( double  _arg) [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.

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 void itk::AmoebaOptimizer::SetOptimizeWithRestarts ( bool  _arg) [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 void itk::AmoebaOptimizer::SetParametersConvergenceTolerance ( double  _arg) [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().

void itk::AmoebaOptimizer::StartOptimization ( void  ) [virtual]

Start optimization with an initial value.

Reimplemented from itk::Optimizer.

Check that the settings are valid. If not throw an exception.


Member Data Documentation

Definition at line 172 of file itkAmoebaOptimizer.h.

Definition at line 171 of file itkAmoebaOptimizer.h.

Definition at line 173 of file itkAmoebaOptimizer.h.

Definition at line 169 of file itkAmoebaOptimizer.h.

Definition at line 174 of file itkAmoebaOptimizer.h.

ParametersType::ValueType itk::AmoebaOptimizer::m_ParametersConvergenceTolerance [private]

Definition at line 170 of file itkAmoebaOptimizer.h.

Definition at line 177 of file itkAmoebaOptimizer.h.

vnl_amoeba* itk::AmoebaOptimizer::m_VnlOptimizer [private]

Definition at line 175 of file itkAmoebaOptimizer.h.


The documentation for this class was generated from the following file: