ITK  4.9.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType > Class Template Referenceabstract

#include <itkGradientDescentOptimizerBasev4.h>

+ Inheritance diagram for itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >:
+ Collaboration diagram for itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >:

Detailed Description

template<typename TInternalComputationValueType>
class itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >

Definition at line 39 of file itkGradientDescentOptimizerBasev4.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef
itk::Function::WindowConvergenceMonitoringFunction
< TInternalComputationValueType > 
ConvergenceMonitoringType
 
typedef Superclass::DerivativeType DerivativeType
 
typedef
ThreadedIndexedContainerPartitioner::IndexRangeType 
IndexRangeType
 
typedef
TInternalComputationValueType 
InternalComputationValueType
 
typedef Superclass::MeasureType MeasureType
 
typedef Superclass::MetricType MetricType
 
typedef MetricType::Pointer MetricTypePointer
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef Superclass::ScalesType ScalesType
 
typedef
GradientDescentOptimizerBasev4Template 
Self
 
typedef
Superclass::StopConditionDescriptionType 
StopConditionDescriptionType
 
typedef
Superclass::StopConditionReturnStringType 
StopConditionReturnStringType
 
enum  StopConditionType {
  MAXIMUM_NUMBER_OF_ITERATIONS,
  COSTFUNCTION_ERROR,
  UPDATE_PARAMETERS_ERROR,
  STEP_TOO_SMALL,
  CONVERGENCE_CHECKER_PASSED,
  GRADIENT_MAGNITUDE_TOLEARANCE,
  OTHER_ERROR
}
 
typedef
ObjectToObjectOptimizerBaseTemplate
< TInternalComputationValueType > 
Superclass
 
- Public Types inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
typedef SmartPointer< const SelfConstPointer
 
typedef MetricType::DerivativeType DerivativeType
 
typedef MetricType::MeasureType MeasureType
 
typedef
ObjectToObjectMetricBaseTemplate
< TInternalComputationValueType > 
MetricType
 
typedef MetricType::Pointer MetricTypePointer
 
typedef
MetricType::NumberOfParametersType 
NumberOfParametersType
 
typedef OptimizerParameters
< TInternalComputationValueType > 
ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef
OptimizerParameterScalesEstimatorTemplate
< TInternalComputationValueType > 
ScalesEstimatorType
 
typedef OptimizerParameters
< TInternalComputationValueType > 
ScalesType
 
typedef
ObjectToObjectOptimizerBaseTemplate 
Self
 
typedef std::ostringstream StopConditionDescriptionType
 
typedef std::string StopConditionReturnStringType
 
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 SizeValueType GetCurrentIteration () const override
 
virtual const DerivativeTypeGetGradient () const
 
virtual const char * GetNameOfClass () const
 
virtual SizeValueType GetNumberOfIterations () const override
 
virtual const StopConditionTypeGetStopCondition () const
 
virtual const
StopConditionReturnStringType 
GetStopConditionDescription () const override
 
virtual void ModifyGradientByLearningRateOverSubRange (const IndexRangeType &subrange)=0
 
virtual void ModifyGradientByScalesOverSubRange (const IndexRangeType &subrange)=0
 
virtual void ResumeOptimization ()=0
 
virtual void StartOptimization (bool doOnlyInitialization=false) override
 
virtual void StopOptimization ()
 
virtual void SetNumberOfIterations (const SizeValueType numberOfIterations) override
 
virtual void ModifyGradientByScales ()
 
virtual void ModifyGradientByLearningRate ()
 
- Public Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
virtual const MeasureTypeGetCurrentMetricValue () const
 
virtual const ParametersTypeGetCurrentPosition () const
 
virtual const ThreadIdTypeGetNumberOfThreads () const
 
virtual const ScalesTypeGetScales () const
 
virtual const bool & GetScalesAreIdentity () const
 
bool GetScalesInitialized () const
 
virtual const MeasureTypeGetValue () const
 
virtual const ScalesTypeGetWeights () const
 
virtual const bool & GetWeightsAreIdentity () const
 
virtual void SetNumberOfThreads (ThreadIdType number)
 
virtual void SetScalesEstimator (ScalesEstimatorType *_arg)
 
virtual void SetWeights (ScalesType _arg)
 
virtual void SetMetric (MetricType *_arg)
 
virtual MetricTypeGetModifiableMetric ()
 
virtual const MetricTypeGetMetric () const
 
virtual void SetScales (const ScalesType &scales)
 
virtual void SetDoEstimateScales (bool _arg)
 
virtual const bool & GetDoEstimateScales () const
 
virtual void DoEstimateScalesOn ()
 
virtual void DoEstimateScalesOff ()
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual LightObject::Pointer CreateAnother () const override
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () 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 override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () 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
 

Protected Member Functions

virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
 GradientDescentOptimizerBasev4Template ()
 
virtual ~GradientDescentOptimizerBasev4Template ()
 
- Protected Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
 ObjectToObjectOptimizerBaseTemplate ()
 
virtual ~ObjectToObjectOptimizerBaseTemplate ()
 
- 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

ConvergenceMonitoringType::Pointer m_ConvergenceMonitoring
 
SizeValueType m_ConvergenceWindowSize
 
bool m_DoEstimateLearningRateAtEachIteration
 
bool m_DoEstimateLearningRateOnce
 
DerivativeType m_Gradient
 
TInternalComputationValueType m_MaximumStepSizeInPhysicalUnits
 
DomainThreader
< ThreadedIndexedContainerPartitioner,
Self >::Pointer 
m_ModifyGradientByLearningRateThreader
 
DomainThreader
< ThreadedIndexedContainerPartitioner,
Self >::Pointer 
m_ModifyGradientByScalesThreader
 
bool m_Stop
 
StopConditionType m_StopCondition
 
StopConditionDescriptionType m_StopConditionDescription
 
bool m_UseConvergenceMonitoring
 
- Protected Attributes inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
SizeValueType m_CurrentIteration
 
MeasureType m_CurrentMetricValue
 
bool m_DoEstimateScales
 
MetricTypePointer m_Metric
 
SizeValueType m_NumberOfIterations
 
ThreadIdType m_NumberOfThreads
 
ScalesType m_Scales
 
bool m_ScalesAreIdentity
 
ScalesEstimatorType::Pointer m_ScalesEstimator
 
ScalesType m_Weights
 
bool m_WeightsAreIdentity
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Private Member Functions

 GradientDescentOptimizerBasev4Template (const Self &) ITK_DELETE_FUNCTION
 
void operator= (const Self &) ITK_DELETE_FUNCTION
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Member Typedef Documentation

template<typename TInternalComputationValueType >
typedef SmartPointer< const Self > itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::ConstPointer

Definition at line 47 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef itk::Function::WindowConvergenceMonitoringFunction<TInternalComputationValueType> itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::ConvergenceMonitoringType

Type for the convergence checker

Definition at line 88 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef Superclass::DerivativeType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::DerivativeType

Derivative type

Definition at line 77 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef ThreadedIndexedContainerPartitioner::IndexRangeType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::IndexRangeType

Definition at line 151 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef TInternalComputationValueType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::InternalComputationValueType

It should be possible to derive the internal computation type from the class object.

Definition at line 70 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef Superclass::MeasureType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::MeasureType

Measure type

Definition at line 80 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef Superclass::MetricType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::MetricType

Metric type over which this class is templated

Definition at line 73 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef MetricType::Pointer itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::MetricTypePointer

Definition at line 74 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef Superclass::ParametersType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::ParametersType

Definition at line 84 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef SmartPointer< Self > itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::Pointer

Definition at line 46 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef Superclass::ScalesType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::ScalesType

Definition at line 82 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef GradientDescentOptimizerBasev4Template itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::Self

Standard class typedefs.

Definition at line 44 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef Superclass::StopConditionDescriptionType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::StopConditionDescriptionType

Stop condition internal string type

Definition at line 67 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef Superclass::StopConditionReturnStringType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::StopConditionReturnStringType

Stop condition return string type

Definition at line 64 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
typedef ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType> itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::Superclass

Definition at line 45 of file itkGradientDescentOptimizerBasev4.h.

Member Enumeration Documentation

template<typename TInternalComputationValueType >
enum itk::GradientDescentOptimizerBasev4Template::StopConditionType

Codes of stopping conditions.

Enumerator
MAXIMUM_NUMBER_OF_ITERATIONS 
COSTFUNCTION_ERROR 
UPDATE_PARAMETERS_ERROR 
STEP_TOO_SMALL 
CONVERGENCE_CHECKER_PASSED 
GRADIENT_MAGNITUDE_TOLEARANCE 
OTHER_ERROR 

Definition at line 53 of file itkGradientDescentOptimizerBasev4.h.

Constructor & Destructor Documentation

template<typename TInternalComputationValueType >
itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GradientDescentOptimizerBasev4Template ( )
protected

Default constructor

template<typename TInternalComputationValueType >
virtual itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::~GradientDescentOptimizerBasev4Template ( )
protectedvirtual

Default constructor

template<typename TInternalComputationValueType >
itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GradientDescentOptimizerBasev4Template ( const Self )
private

Member Function Documentation

template<typename TInternalComputationValueType >
virtual SizeValueType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GetCurrentIteration ( ) const
inlineoverridevirtual
template<typename TInternalComputationValueType >
virtual const DerivativeType& itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GetGradient ( ) const
virtual

Get the most recent gradient values.

template<typename TInternalComputationValueType >
virtual const char* itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GetNameOfClass ( ) const
virtual
template<typename TInternalComputationValueType >
virtual SizeValueType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GetNumberOfIterations ( ) const
inlineoverridevirtual
template<typename TInternalComputationValueType >
virtual const StopConditionType& itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GetStopCondition ( ) const
virtual
template<typename TInternalComputationValueType >
virtual const StopConditionReturnStringType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GetStopConditionDescription ( ) const
overridevirtual
template<typename TInternalComputationValueType >
virtual void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::ModifyGradientByLearningRate ( )
virtual

Modify the gradient in place, to advance the optimization. This call performs a threaded modification for transforms with local support (assumed to be dense). Otherwise the modification is performed w/out threading. See EstimateLearningRate() to perform optionaly learning rate estimation. At completion, m_Gradient can be used to update the transform parameters. Derived classes may hold additional results in other member variables.

See Also
EstimateLearningRate()
template<typename TInternalComputationValueType >
virtual void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::ModifyGradientByLearningRateOverSubRange ( const IndexRangeType subrange)
pure virtual

Derived classes define this worker method to modify the gradient by learning rates. Modifications must be performed over the index range defined in subrange. Called from ModifyGradientByLearningRate(), either directly or via threaded operation. This function is used in GradientDescentOptimizerBasev4ModifyGradientByScalesThreaderTemplate and GradientDescentOptimizerBasev4ModifyGradientByLearningRateThreaderTemplate classes.

Implemented in itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >, and itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >.

template<typename TInternalComputationValueType >
virtual void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::ModifyGradientByScales ( )
virtual

Modify the gradient in place, to advance the optimization. This call performs a threaded modification for transforms with local support (assumed to be dense). Otherwise the modification is performed w/out threading. See EstimateLearningRate() to perform optionaly learning rate estimation. At completion, m_Gradient can be used to update the transform parameters. Derived classes may hold additional results in other member variables.

See Also
EstimateLearningRate()
template<typename TInternalComputationValueType >
virtual void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::ModifyGradientByScalesOverSubRange ( const IndexRangeType subrange)
pure virtual

Derived classes define this worker method to modify the gradient by scales. Modifications must be performed over the index range defined in subrange. Called from ModifyGradientByScales(), either directly or via threaded operation.

Implemented in itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >, and itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >.

template<typename TInternalComputationValueType >
void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::operator= ( const Self )
private
template<typename TInternalComputationValueType >
virtual void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual
template<typename TInternalComputationValueType >
virtual void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::ResumeOptimization ( )
pure virtual

Resume optimization. This runs the optimization loop, and allows continuation of stopped optimization

Implemented in itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >, and itk::MultiGradientOptimizerv4Template< TInternalComputationValueType >.

template<typename TInternalComputationValueType >
virtual void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::SetNumberOfIterations ( const SizeValueType  numberOfIterations)
inlineoverridevirtual
template<typename TInternalComputationValueType >
virtual void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::StartOptimization ( bool  doOnlyInitialization = false)
overridevirtual
template<typename TInternalComputationValueType >
virtual void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::StopOptimization ( )
virtual

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

Reimplemented in itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >, and itk::MultiGradientOptimizerv4Template< TInternalComputationValueType >.

Member Data Documentation

template<typename TInternalComputationValueType >
ConvergenceMonitoringType::Pointer itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_ConvergenceMonitoring
protected

The convergence checker.

Definition at line 208 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
SizeValueType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_ConvergenceWindowSize
protected

Window size for the convergence checker. The convergence checker calculates convergence value by fitting to a window of the energy (metric value) profile.

Definition at line 205 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
bool itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_DoEstimateLearningRateAtEachIteration
protected

Flag to control use of the ScalesEstimator (if set) for automatic learning step estimation at each iteration.

Definition at line 180 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
bool itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_DoEstimateLearningRateOnce
protected

Flag to control use of the ScalesEstimator (if set) for automatic learning step estimation only once, during first iteration.

Definition at line 185 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
DerivativeType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_Gradient
protected

Current gradient

Definition at line 219 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
TInternalComputationValueType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_MaximumStepSizeInPhysicalUnits
protected

The maximum step size in physical units, to restrict learning rates. Only used with automatic learning rate estimation. It may be initialized either by calling SetMaximumStepSizeInPhysicalUnits manually or by using m_ScalesEstimator automatically, and the former has higher priority than the latter. See main documentation.

Definition at line 193 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
DomainThreader<ThreadedIndexedContainerPartitioner, Self>::Pointer itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_ModifyGradientByLearningRateThreader
protected

Definition at line 211 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
DomainThreader<ThreadedIndexedContainerPartitioner, Self>::Pointer itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_ModifyGradientByScalesThreader
protected

Definition at line 210 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
bool itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_Stop
protected

Definition at line 214 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
StopConditionType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_StopCondition
protected

Definition at line 215 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
StopConditionDescriptionType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_StopConditionDescription
protected

Definition at line 216 of file itkGradientDescentOptimizerBasev4.h.

template<typename TInternalComputationValueType >
bool itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_UseConvergenceMonitoring
protected

Flag to control using the convergence monitoring for stop condition. This flag should be always set to true except for regular step gradient descent optimizer that uses minimum step length to check the convergence.

Definition at line 199 of file itkGradientDescentOptimizerBasev4.h.


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