ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType > Class Template Referenceabstract

#include <itkGradientDescentOptimizerBasev4.h>

Detailed Description

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

Definition at line 40 of file itkGradientDescentOptimizerBasev4.h.

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

Public Types

using ConstPointer = SmartPointer< const Self >
 
using ConvergenceMonitoringType = itk::Function::WindowConvergenceMonitoringFunction< TInternalComputationValueType >
 
using IndexRangeType = ThreadedIndexedContainerPartitioner::IndexRangeType
 
using InternalComputationValueType = TInternalComputationValueType
 
using MetricTypePointer = typename MetricType::Pointer
 
using Pointer = SmartPointer< Self >
 
using Self = GradientDescentOptimizerBasev4Template
 
using Superclass = ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
 
- Public Types inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
using ConstPointer = SmartPointer< const Self >
 
using DerivativeType = typename MetricType::DerivativeType
 
using MeasureType = typename MetricType::MeasureType
 
using MetricType = ObjectToObjectMetricBaseTemplate< TInternalComputationValueType >
 
using MetricTypePointer = typename MetricType::Pointer
 
using NumberOfParametersType = typename MetricType::NumberOfParametersType
 
using ParametersType = OptimizerParameters< TInternalComputationValueType >
 
using Pointer = SmartPointer< Self >
 
using ScalesEstimatorType = OptimizerParameterScalesEstimatorTemplate< TInternalComputationValueType >
 
using ScalesType = OptimizerParameters< TInternalComputationValueType >
 
using Self = ObjectToObjectOptimizerBaseTemplate
 
using StopConditionDescriptionType = std::ostringstream
 
using StopConditionReturnStringType = std::string
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

virtual const DerivativeTypeGetGradient () const
 
const char * GetNameOfClass () const override
 
virtual const StopConditionObjectToObjectOptimizerEnumGetStopCondition () const
 
StopConditionReturnStringType GetStopConditionDescription () const override
 
virtual void ModifyGradientByLearningRateOverSubRange (const IndexRangeType &subrange)=0
 
virtual void ModifyGradientByScalesOverSubRange (const IndexRangeType &subrange)=0
 
virtual void ResumeOptimization ()=0
 
void StartOptimization (bool doOnlyInitialization=false) override
 
virtual void StopOptimization ()
 
virtual void ModifyGradientByScales ()
 
virtual void ModifyGradientByLearningRate ()
 
- Public Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
virtual bool CanUseScales () const
 
virtual SizeValueType GetCurrentIteration () const
 
virtual const MeasureTypeGetCurrentMetricValue () const
 
virtual const ParametersTypeGetCurrentPosition () const
 
const char * GetNameOfClass () const override
 
virtual SizeValueType GetNumberOfIterations () const
 
virtual const ThreadIdTypeGetNumberOfWorkUnits () 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 SetNumberOfIterations (SizeValueType _arg)
 
virtual void SetNumberOfWorkUnits (ThreadIdType number)
 
virtual void SetScalesEstimator (ScalesEstimatorType *_arg)
 
virtual void SetWeights (ScalesType _arg)
 
virtual void SetMetric (MetricType *_arg)
 
virtual MetricTypeGetModifiableMetric ()
 
virtual void SetScales (const ScalesType &scales)
 
virtual void SetDoEstimateScales (bool _arg)
 
virtual const bool & GetDoEstimateScales () const
 
virtual void DoEstimateScalesOn ()
 
- 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
 
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
 
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
 

Protected Member Functions

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

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 { false }
 
StopConditionObjectToObjectOptimizerEnum 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_NumberOfWorkUnits {}
 
ScalesType m_Scales {}
 
bool m_ScalesAreIdentity {}
 
ScalesEstimatorType::Pointer m_ScalesEstimator {}
 
ScalesType m_Weights {}
 
bool m_WeightsAreIdentity {}
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

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 val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Member Typedef Documentation

◆ ConstPointer

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

Definition at line 50 of file itkGradientDescentOptimizerBasev4.h.

◆ ConvergenceMonitoringType

template<typename TInternalComputationValueType >
using itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::ConvergenceMonitoringType = itk::Function::WindowConvergenceMonitoringFunction<TInternalComputationValueType>

Type for the convergence checker

Definition at line 97 of file itkGradientDescentOptimizerBasev4.h.

◆ IndexRangeType

template<typename TInternalComputationValueType >
using itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::IndexRangeType = ThreadedIndexedContainerPartitioner::IndexRangeType

Definition at line 142 of file itkGradientDescentOptimizerBasev4.h.

◆ InternalComputationValueType

template<typename TInternalComputationValueType >
using itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::InternalComputationValueType = TInternalComputationValueType

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

Definition at line 80 of file itkGradientDescentOptimizerBasev4.h.

◆ MetricTypePointer

template<typename TInternalComputationValueType >
using itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::MetricTypePointer = typename MetricType::Pointer

Definition at line 84 of file itkGradientDescentOptimizerBasev4.h.

◆ Pointer

template<typename TInternalComputationValueType >
using itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::Pointer = SmartPointer<Self>

Definition at line 49 of file itkGradientDescentOptimizerBasev4.h.

◆ Self

template<typename TInternalComputationValueType >
using itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::Self = GradientDescentOptimizerBasev4Template

Standard class type aliases.

Definition at line 47 of file itkGradientDescentOptimizerBasev4.h.

◆ Superclass

template<typename TInternalComputationValueType >
using itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::Superclass = ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType>

Definition at line 48 of file itkGradientDescentOptimizerBasev4.h.

Constructor & Destructor Documentation

◆ GradientDescentOptimizerBasev4Template()

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

Default constructor

◆ ~GradientDescentOptimizerBasev4Template()

template<typename TInternalComputationValueType >
itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::~GradientDescentOptimizerBasev4Template ( )
overrideprotecteddefault

Default constructor

Member Function Documentation

◆ GetGradient()

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

Get the most recent gradient values.

◆ GetNameOfClass()

template<typename TInternalComputationValueType >
const char* itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GetNameOfClass ( ) const
overridevirtual

◆ GetStopCondition()

template<typename TInternalComputationValueType >
virtual const StopConditionObjectToObjectOptimizerEnum& itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GetStopCondition ( ) const
virtual

◆ GetStopConditionDescription()

template<typename TInternalComputationValueType >
StopConditionReturnStringType itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::GetStopConditionDescription ( ) const
overridevirtual

◆ ModifyGradientByLearningRate()

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 optionally 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()

◆ ModifyGradientByLearningRateOverSubRange()

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

◆ ModifyGradientByScales()

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 optionally 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()

◆ ModifyGradientByScalesOverSubRange()

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

◆ PrintSelf()

template<typename TInternalComputationValueType >
void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
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.

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

◆ ResumeOptimization()

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

◆ StartOptimization()

template<typename TInternalComputationValueType >
void itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::StartOptimization ( bool  doOnlyInitialization = false)
overridevirtual

◆ StopOptimization()

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

◆ m_ConvergenceMonitoring

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

The convergence checker.

Definition at line 200 of file itkGradientDescentOptimizerBasev4.h.

◆ m_ConvergenceWindowSize

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 197 of file itkGradientDescentOptimizerBasev4.h.

◆ m_DoEstimateLearningRateAtEachIteration

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 172 of file itkGradientDescentOptimizerBasev4.h.

◆ m_DoEstimateLearningRateOnce

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 177 of file itkGradientDescentOptimizerBasev4.h.

◆ m_Gradient

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

Current gradient

Definition at line 211 of file itkGradientDescentOptimizerBasev4.h.

◆ m_MaximumStepSizeInPhysicalUnits

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 185 of file itkGradientDescentOptimizerBasev4.h.

◆ m_ModifyGradientByLearningRateThreader

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

Definition at line 203 of file itkGradientDescentOptimizerBasev4.h.

◆ m_ModifyGradientByScalesThreader

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

Definition at line 202 of file itkGradientDescentOptimizerBasev4.h.

◆ m_Stop

template<typename TInternalComputationValueType >
bool itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_Stop { false }
protected

Definition at line 206 of file itkGradientDescentOptimizerBasev4.h.

◆ m_StopCondition

template<typename TInternalComputationValueType >
StopConditionObjectToObjectOptimizerEnum itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >::m_StopCondition {}
protected

Definition at line 207 of file itkGradientDescentOptimizerBasev4.h.

◆ m_StopConditionDescription

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

Definition at line 208 of file itkGradientDescentOptimizerBasev4.h.

◆ m_UseConvergenceMonitoring

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 191 of file itkGradientDescentOptimizerBasev4.h.


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