ITK  4.3.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
itk::MultiGradientOptimizerv4 Class Reference

#include <itkMultiGradientOptimizerv4.h>

+ Inheritance diagram for itk::MultiGradientOptimizerv4:
+ Collaboration diagram for itk::MultiGradientOptimizerv4:

Detailed Description

Multiple gradient-based optimizers are combined in order to perform a multi-objective optimization.

This optimizer will do a combined gradient descent optimization using whatever metric/optimizer gradient sub-optimizers are passed to it by the user. The learning rate or scaleestimator for each sub-optimizer controls the relative weight of each metric in the optimization. Denote the weights as $ w_1 $ and $ w_2 $ then the MultiGradientOptimizer will optimize $ \sum_i w_i Metric_i $ by using update rule:

\[ params_{new} = params_{old} + \frac{1}{N_{Metrics}} * ( \sum_i w_i Grad(Metric_i) ) \]

Note
The scales, learning rates and weights options must be set individually for each sub-optimizer, and have no effect when set on this class.

The test for this class illustrates the expected behavior.

Definition at line 45 of file itkMultiGradientOptimizerv4.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef MetricType::DerivativeType DerivativeType
 
typedef
Superclass::InternalComputationValueType 
InternalComputationValueType
 
typedef
itk::GradientDescentOptimizerv4::Pointer 
LocalOptimizerPointer
 
typedef
itk::GradientDescentOptimizerv4 
LocalOptimizerType
 
typedef Superclass::MeasureType MeasureType
 
typedef Superclass::MetricType MetricType
 
typedef MetricType::Pointer MetricTypePointer
 
typedef std::vector< MeasureTypeMetricValuesListType
 
typedef OptimizerType::Pointer OptimizerPointer
 
typedef
OptimizersListType::size_type 
OptimizersListSizeType
 
typedef std::vector
< LocalOptimizerPointer
OptimizersListType
 
typedef ObjectToObjectOptimizerBase OptimizerType
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef MultiGradientOptimizerv4 Self
 
typedef std::ostringstream StopConditionDescriptionType
 
typedef std::string StopConditionReturnStringType
 
typedef GradientDescentOptimizerv4 Superclass
 
- Public Types inherited from itk::GradientDescentOptimizerv4
typedef SmartPointer< const SelfConstPointer
 
typedef
itk::Function::WindowConvergenceMonitoringFunction
< double > 
ConvergenceMonitoringType
 
typedef Superclass::DerivativeType DerivativeType
 
typedef
Superclass::InternalComputationValueType 
InternalComputationValueType
 
typedef Superclass::MeasureType MeasureType
 
typedef SmartPointer< SelfPointer
 
typedef GradientDescentOptimizerv4 Self
 
typedef
GradientDescentOptimizerBasev4 
Superclass
 
- Public Types inherited from itk::GradientDescentOptimizerBasev4
typedef SmartPointer< const SelfConstPointer
 
typedef MetricType::DerivativeType DerivativeType
 
typedef
Superclass::InternalComputationValueType 
InternalComputationValueType
 
typedef Superclass::MeasureType MeasureType
 
typedef Superclass::MetricType MetricType
 
typedef MetricType::Pointer MetricTypePointer
 
typedef SmartPointer< SelfPointer
 
typedef
GradientDescentOptimizerBasev4 
Self
 
typedef std::ostringstream StopConditionDescriptionType
 
typedef std::string StopConditionReturnStringType
 
enum  StopConditionType {
  MAXIMUM_NUMBER_OF_ITERATIONS,
  COSTFUNCTION_ERROR,
  UPDATE_PARAMETERS_ERROR,
  STEP_TOO_SMALL,
  QUASI_NEWTON_STEP_ERROR,
  CONVERGENCE_CHECKER_PASSED,
  OTHER_ERROR
}
 
typedef ObjectToObjectOptimizerBase Superclass
 
- Public Types inherited from itk::ObjectToObjectOptimizerBase
typedef SmartPointer< const SelfConstPointer
 
typedef
MetricType::InternalComputationValueType 
InternalComputationValueType
 
typedef MetricType::MeasureType MeasureType
 
typedef ObjectToObjectMetricBase MetricType
 
typedef MetricType::Pointer MetricTypePointer
 
typedef
MetricType::NumberOfParametersType 
NumberOfParametersType
 
typedef OptimizerParameters
< double > 
ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef OptimizerParameters
< double > 
ScalesType
 
typedef ObjectToObjectOptimizerBase Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual SizeValueType GetCurrentIteration () const
 
const MetricValuesListTypeGetMetricValuesList () const
 
virtual const char * GetNameOfClass () const
 
virtual const SizeValueTypeGetNumberOfIterations ()
 
OptimizersListTypeGetOptimizersList ()
 
virtual const StopConditionTypeGetStopCondition ()
 
virtual const
StopConditionReturnStringType 
GetStopConditionDescription () const
 
virtual void ResumeOptimization ()
 
virtual void SetNumberOfIterations (SizeValueType _arg)
 
void SetOptimizersList (OptimizersListType &p)
 
virtual void StartOptimization (bool doOnlyInitialization=false)
 
virtual void StopOptimization (void)
 
- Public Member Functions inherited from itk::GradientDescentOptimizerv4
virtual void EstimateLearningRate ()
 
virtual const
InternalComputationValueType
GetConvergenceValue ()
 
virtual const
InternalComputationValueType
GetLearningRate ()
 
virtual const
InternalComputationValueType
GetMaximumStepSizeInPhysicalUnits ()
 
virtual void SetConvergenceWindowSize (SizeValueType _arg)
 
virtual void SetLearningRate (InternalComputationValueType _arg)
 
virtual void SetMaximumStepSizeInPhysicalUnits (InternalComputationValueType _arg)
 
virtual void SetMinimumConvergenceValue (InternalComputationValueType _arg)
 
virtual void SetScalesEstimator (OptimizerParameterScalesEstimator *_arg)
 
virtual void SetDoEstimateScales (bool _arg)
 
virtual const bool & GetDoEstimateScales ()
 
virtual void DoEstimateScalesOn ()
 
virtual void DoEstimateScalesOff ()
 
virtual void SetDoEstimateLearningRateAtEachIteration (bool _arg)
 
virtual const bool & GetDoEstimateLearningRateAtEachIteration ()
 
virtual void DoEstimateLearningRateAtEachIterationOn ()
 
virtual void DoEstimateLearningRateAtEachIterationOff ()
 
virtual void SetDoEstimateLearningRateOnce (bool _arg)
 
virtual const bool & GetDoEstimateLearningRateOnce ()
 
virtual void DoEstimateLearningRateOnceOn ()
 
virtual void DoEstimateLearningRateOnceOff ()
 
virtual void SetReturnBestParametersAndValue (bool _arg)
 
virtual const bool & GetReturnBestParametersAndValue ()
 
virtual void ReturnBestParametersAndValueOn ()
 
virtual void ReturnBestParametersAndValueOff ()
 
- Public Member Functions inherited from itk::GradientDescentOptimizerBasev4
virtual const DerivativeTypeGetGradient ()
 
virtual void ModifyGradientByScales ()
 
virtual void ModifyGradientByLearningRate ()
 
- Public Member Functions inherited from itk::ObjectToObjectOptimizerBase
virtual const MeasureTypeGetCurrentMetricValue ()
 
const ParametersTypeGetCurrentPosition ()
 
virtual const ThreadIdTypeGetNumberOfThreads ()
 
virtual const ScalesTypeGetScales ()
 
virtual const bool & GetScalesAreIdentity ()
 
const MeasureTypeGetValue ()
 
virtual const ScalesTypeGetWeights ()
 
virtual const bool & GetWeightsAreIdentity ()
 
virtual void SetNumberOfThreads (ThreadIdType number)
 
virtual void SetScales (ScalesType _arg)
 
virtual void SetWeights (ScalesType _arg)
 
virtual MetricTypeGetMetric ()
 
virtual void SetMetric (MetricType *_arg)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary (void)
 
const MetaDataDictionaryGetMetaDataDictionary (void) const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int)
 
virtual void UnRegister () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::GradientDescentOptimizerv4
static Pointer New ()
 

Protected Member Functions

virtual void PrintSelf (std::ostream &os, Indent indent) const
 
 MultiGradientOptimizerv4 ()
 
virtual ~MultiGradientOptimizerv4 ()
 
- Protected Member Functions inherited from itk::GradientDescentOptimizerv4
virtual void AdvanceOneStep (void)
 
 GradientDescentOptimizerv4 ()
 
virtual ~GradientDescentOptimizerv4 ()
 
virtual void ModifyGradientByScalesOverSubRange (const IndexRangeType &subrange)
 
virtual void ModifyGradientByLearningRateOverSubRange (const IndexRangeType &subrange)
 
- Protected Member Functions inherited from itk::GradientDescentOptimizerBasev4
 GradientDescentOptimizerBasev4 ()
 
virtual ~GradientDescentOptimizerBasev4 ()
 
- Protected Member Functions inherited from itk::ObjectToObjectOptimizerBase
 ObjectToObjectOptimizerBase ()
 
virtual ~ObjectToObjectOptimizerBase ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- 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 ()
 

Protected Attributes

SizeValueType m_CurrentIteration
 
MeasureType m_MaximumMetricValue
 
MetricValuesListType m_MetricValuesList
 
MeasureType m_MinimumMetricValue
 
SizeValueType m_NumberOfIterations
 
OptimizersListType m_OptimizersList
 
bool m_Stop
 
StopConditionType m_StopCondition
 
StopConditionDescriptionType m_StopConditionDescription
 
- Protected Attributes inherited from itk::GradientDescentOptimizerv4
ParametersType m_BestParameters
 
ConvergenceMonitoringType::Pointer m_ConvergenceMonitoring
 
InternalComputationValueType m_ConvergenceValue
 
SizeValueType m_ConvergenceWindowSize
 
MeasureType m_CurrentBestValue
 
InternalComputationValueType m_LearningRate
 
InternalComputationValueType m_MaximumStepSizeInPhysicalUnits
 
InternalComputationValueType m_MinimumConvergenceValue
 
bool m_ReturnBestParametersAndValue
 
OptimizerParameterScalesEstimator::Pointer m_ScalesEstimator
 
- Protected Attributes inherited from itk::GradientDescentOptimizerBasev4
SizeValueType m_CurrentIteration
 
DerivativeType m_Gradient
 
GradientDescentOptimizerBasev4ModifyGradientByLearningRateThreader::Pointer m_ModifyGradientByLearningRateThreader
 
GradientDescentOptimizerBasev4ModifyGradientByScalesThreader::Pointer m_ModifyGradientByScalesThreader
 
SizeValueType m_NumberOfIterations
 
bool m_Stop
 
StopConditionType m_StopCondition
 
StopConditionDescriptionType m_StopConditionDescription
 
- Protected Attributes inherited from itk::ObjectToObjectOptimizerBase
MeasureType m_CurrentMetricValue
 
MetricTypePointer m_Metric
 
ThreadIdType m_NumberOfThreads
 
ScalesType m_Scales
 
bool m_ScalesAreIdentity
 
ScalesType m_Weights
 
bool m_WeightsAreIdentity
 

Private Member Functions

 MultiGradientOptimizerv4 (const Self &)
 
void operator= (const Self &)
 

Additional Inherited Members

- Protected Types inherited from itk::GradientDescentOptimizerBasev4
typedef
GradientDescentOptimizerBasev4ModifyGradientByScalesThreader::IndexRangeType 
IndexRangeType
 

Member Typedef Documentation

Definition at line 53 of file itkMultiGradientOptimizerv4.h.

Derivative type

Definition at line 80 of file itkMultiGradientOptimizerv4.h.

typedef Superclass::InternalComputationValueType itk::MultiGradientOptimizerv4::InternalComputationValueType

Internal computation type, for maintaining a desired precision

Definition at line 87 of file itkMultiGradientOptimizerv4.h.

Definition at line 62 of file itkMultiGradientOptimizerv4.h.

Definition at line 59 of file itkMultiGradientOptimizerv4.h.

typedef Superclass::MeasureType itk::MultiGradientOptimizerv4::MeasureType

Measure type

Definition at line 83 of file itkMultiGradientOptimizerv4.h.

typedef Superclass::MetricType itk::MultiGradientOptimizerv4::MetricType

Metric type over which this class is templated

Definition at line 76 of file itkMultiGradientOptimizerv4.h.

Definition at line 77 of file itkMultiGradientOptimizerv4.h.

Definition at line 84 of file itkMultiGradientOptimizerv4.h.

Definition at line 65 of file itkMultiGradientOptimizerv4.h.

typedef OptimizersListType::size_type itk::MultiGradientOptimizerv4::OptimizersListSizeType

Definition at line 67 of file itkMultiGradientOptimizerv4.h.

Definition at line 66 of file itkMultiGradientOptimizerv4.h.

Definition at line 64 of file itkMultiGradientOptimizerv4.h.

typedef Superclass::ParametersType itk::MultiGradientOptimizerv4::ParametersType

Definition at line 63 of file itkMultiGradientOptimizerv4.h.

Definition at line 52 of file itkMultiGradientOptimizerv4.h.

Standard class typedefs.

Definition at line 50 of file itkMultiGradientOptimizerv4.h.

Stop condition internal string type

Definition at line 73 of file itkMultiGradientOptimizerv4.h.

Stop condition return string type

Definition at line 70 of file itkMultiGradientOptimizerv4.h.

Definition at line 51 of file itkMultiGradientOptimizerv4.h.

Constructor & Destructor Documentation

itk::MultiGradientOptimizerv4::MultiGradientOptimizerv4 ( )
protected

Default constructor

virtual itk::MultiGradientOptimizerv4::~MultiGradientOptimizerv4 ( )
protectedvirtual

Default constructor

itk::MultiGradientOptimizerv4::MultiGradientOptimizerv4 ( const Self )
private

Member Function Documentation

virtual::itk::LightObject::Pointer itk::MultiGradientOptimizerv4::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::GradientDescentOptimizerv4.

virtual SizeValueType itk::MultiGradientOptimizerv4::GetCurrentIteration ( ) const
virtual

Get the current iteration number.

Reimplemented from itk::GradientDescentOptimizerBasev4.

const MetricValuesListType& itk::MultiGradientOptimizerv4::GetMetricValuesList ( ) const

Get the list of metric values that we produced after the multi-objective search.

virtual const char* itk::MultiGradientOptimizerv4::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::GradientDescentOptimizerv4.

virtual const SizeValueType& itk::MultiGradientOptimizerv4::GetNumberOfIterations ( )
virtual

Get the number of iterations.

Reimplemented from itk::GradientDescentOptimizerBasev4.

OptimizersListType& itk::MultiGradientOptimizerv4::GetOptimizersList ( )

Get the list of optimizers currently held.

virtual const StopConditionType& itk::MultiGradientOptimizerv4::GetStopCondition ( )
virtual

Get stop condition enum

Reimplemented from itk::GradientDescentOptimizerBasev4.

virtual const StopConditionReturnStringType itk::MultiGradientOptimizerv4::GetStopConditionDescription ( ) const
virtual

Get the reason for termination

Reimplemented from itk::GradientDescentOptimizerBasev4.

static Pointer itk::MultiGradientOptimizerv4::New ( )
static

Method for creation through the object factory.

void itk::MultiGradientOptimizerv4::operator= ( const Self )
private
virtual void itk::MultiGradientOptimizerv4::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protectedvirtual

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::GradientDescentOptimizerv4.

virtual void itk::MultiGradientOptimizerv4::ResumeOptimization ( )
virtual

Resume the optimization. Can be called after StopOptimization to resume. The bulk of the optimization work loop is here.

Reimplemented from itk::GradientDescentOptimizerv4.

virtual void itk::MultiGradientOptimizerv4::SetNumberOfIterations ( SizeValueType  _arg)
virtual

Set the number of iterations.

Reimplemented from itk::GradientDescentOptimizerBasev4.

void itk::MultiGradientOptimizerv4::SetOptimizersList ( OptimizersListType p)

Set the list of optimizers to combine

virtual void itk::MultiGradientOptimizerv4::StartOptimization ( bool  doOnlyInitialization = false)
virtual

Begin the optimization

Reimplemented from itk::GradientDescentOptimizerv4.

virtual void itk::MultiGradientOptimizerv4::StopOptimization ( void  )
virtual

Stop optimization. The object is left in a state so the optimization can be resumed by calling ResumeOptimization.

Reimplemented from itk::GradientDescentOptimizerv4.

Member Data Documentation

SizeValueType itk::MultiGradientOptimizerv4::m_CurrentIteration
protected

Definition at line 138 of file itkMultiGradientOptimizerv4.h.

MeasureType itk::MultiGradientOptimizerv4::m_MaximumMetricValue
protected

Definition at line 142 of file itkMultiGradientOptimizerv4.h.

MetricValuesListType itk::MultiGradientOptimizerv4::m_MetricValuesList
protected

Definition at line 140 of file itkMultiGradientOptimizerv4.h.

MeasureType itk::MultiGradientOptimizerv4::m_MinimumMetricValue
protected

Definition at line 141 of file itkMultiGradientOptimizerv4.h.

SizeValueType itk::MultiGradientOptimizerv4::m_NumberOfIterations
protected

Definition at line 137 of file itkMultiGradientOptimizerv4.h.

OptimizersListType itk::MultiGradientOptimizerv4::m_OptimizersList
protected

Definition at line 139 of file itkMultiGradientOptimizerv4.h.

bool itk::MultiGradientOptimizerv4::m_Stop
protected

Definition at line 134 of file itkMultiGradientOptimizerv4.h.

StopConditionType itk::MultiGradientOptimizerv4::m_StopCondition
protected

Definition at line 135 of file itkMultiGradientOptimizerv4.h.

StopConditionDescriptionType itk::MultiGradientOptimizerv4::m_StopConditionDescription
protected

Definition at line 136 of file itkMultiGradientOptimizerv4.h.


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