ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType > Class Template Reference

#include <itkConjugateGradientLineSearchOptimizerv4.h>

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

Public Types

using ConstPointer = SmartPointer< const Self >
 
using ConvergenceMonitoringType = itk::Function::WindowConvergenceMonitoringFunction< TInternalComputationValueType >
 
using DerivativeType = typename Superclass::DerivativeType
 
using InternalComputationValueType = TInternalComputationValueType
 
using MeasureType = typename Superclass::MeasureType
 
using Pointer = SmartPointer< Self >
 
using Self = ConjugateGradientLineSearchOptimizerv4Template
 
using Superclass = GradientDescentLineSearchOptimizerv4Template< TInternalComputationValueType >
 
- Public Types inherited from itk::GradientDescentLineSearchOptimizerv4Template< TInternalComputationValueType >
using ConstPointer = SmartPointer< const Self >
 
using ConvergenceMonitoringType = itk::Function::WindowConvergenceMonitoringFunction< TInternalComputationValueType >
 
using DerivativeType = typename Superclass::DerivativeType
 
using InternalComputationValueType = TInternalComputationValueType
 
using MeasureType = typename Superclass::MeasureType
 
using ParametersType = typename Superclass::ParametersType
 
using Pointer = SmartPointer< Self >
 
using Self = GradientDescentLineSearchOptimizerv4Template
 
using Superclass = GradientDescentOptimizerv4Template< TInternalComputationValueType >
 
- Public Types inherited from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >
using ConstPointer = SmartPointer< const Self >
 
using DerivativeType = typename Superclass::DerivativeType
 
using IndexRangeType = typename Superclass::IndexRangeType
 
using InternalComputationValueType = TInternalComputationValueType
 
using MeasureType = typename Superclass::MeasureType
 
using ParametersType = typename Superclass::ParametersType
 
using Pointer = SmartPointer< Self >
 
using ScalesType = typename Superclass::ScalesType
 
using Self = GradientDescentOptimizerv4Template
 
using Superclass = GradientDescentOptimizerBasev4Template< TInternalComputationValueType >
 
- Public Types inherited from itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >
using ConstPointer = SmartPointer< const Self >
 
using ConvergenceMonitoringType = itk::Function::WindowConvergenceMonitoringFunction< TInternalComputationValueType >
 
using DerivativeType = typename Superclass::DerivativeType
 
using InternalComputationValueType = TInternalComputationValueType
 
using MeasureType = typename Superclass::MeasureType
 
using MetricType = typename Superclass::MetricType
 
using MetricTypePointer = typename MetricType::Pointer
 
using ParametersType = typename Superclass::ParametersType
 
using Pointer = SmartPointer< Self >
 
using ScalesType = typename Superclass::ScalesType
 
using Self = GradientDescentOptimizerBasev4Template
 
using StopConditionDescriptionType = typename Superclass::StopConditionDescriptionType
 
using StopConditionReturnStringType = typename Superclass::StopConditionReturnStringType
 
using Superclass = ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
 
using IndexRangeType = ThreadedIndexedContainerPartitioner::IndexRangeType
 
- 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 ::itk::LightObject::Pointer CreateAnother () const
 
virtual const char * GetNameOfClass () const
 
void StartOptimization (bool doOnlyInitialization=false) override
 
- Public Member Functions inherited from itk::GradientDescentLineSearchOptimizerv4Template< TInternalComputationValueType >
virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual void SetEpsilon (TInternalComputationValueType _arg)
 
virtual TInternalComputationValueType GetEpsilon ()
 
virtual void SetLowerLimit (TInternalComputationValueType _arg)
 
virtual TInternalComputationValueType GetLowerLimit ()
 
virtual void SetUpperLimit (TInternalComputationValueType _arg)
 
virtual TInternalComputationValueType GetUpperLimit ()
 
virtual void SetMaximumLineSearchIterations (unsigned int _arg)
 
virtual unsigned int GetMaximumLineSearchIterations ()
 
- Public Member Functions inherited from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >
virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual void SetLearningRate (TInternalComputationValueType _arg)
 
virtual const TInternalComputationValueType & GetLearningRate () const
 
virtual void SetMaximumStepSizeInPhysicalUnits (TInternalComputationValueType _arg)
 
virtual const TInternalComputationValueType & GetMaximumStepSizeInPhysicalUnits () const
 
virtual void SetDoEstimateLearningRateAtEachIteration (bool _arg)
 
virtual const bool & GetDoEstimateLearningRateAtEachIteration () const
 
virtual void DoEstimateLearningRateAtEachIterationOn ()
 
virtual void DoEstimateLearningRateAtEachIterationOff ()
 
virtual void SetDoEstimateLearningRateOnce (bool _arg)
 
virtual const bool & GetDoEstimateLearningRateOnce () const
 
virtual void DoEstimateLearningRateOnceOn ()
 
virtual void DoEstimateLearningRateOnceOff ()
 
virtual void SetMinimumConvergenceValue (TInternalComputationValueType _arg)
 
virtual void SetConvergenceWindowSize (SizeValueType _arg)
 
virtual const TInternalComputationValueType & GetConvergenceValue () const
 
virtual void SetReturnBestParametersAndValue (bool _arg)
 
virtual const bool & GetReturnBestParametersAndValue () const
 
virtual void ReturnBestParametersAndValueOn ()
 
virtual void ReturnBestParametersAndValueOff ()
 
void StartOptimization (bool doOnlyInitialization=false) override
 
void StopOptimization () override
 
void ResumeOptimization () override
 
virtual void EstimateLearningRate ()
 
- Public Member Functions inherited from itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >
virtual const DerivativeTypeGetGradient () const
 
virtual const StopConditionObjectToObjectOptimizerEnumGetStopCondition () const
 
void SetNumberOfIterations (const SizeValueType numberOfIterations) override
 
SizeValueType GetNumberOfIterations () const override
 
SizeValueType GetCurrentIteration () const override
 
const StopConditionReturnStringType GetStopConditionDescription () const override
 
virtual void ModifyGradientByScales ()
 
virtual void ModifyGradientByLearningRate ()
 
- Public Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
virtual void SetMetric (MetricType *_arg)
 
virtual MetricTypeGetModifiableMetric ()
 
virtual const MetricTypeGetMetric () const
 
virtual const MeasureTypeGetCurrentMetricValue () const
 
virtual const MeasureTypeGetValue () const
 
virtual void SetScales (const ScalesType &scales)
 
virtual const ScalesTypeGetScales () const
 
virtual const bool & GetScalesAreIdentity () const
 
virtual void SetWeights (ScalesType _arg)
 
virtual const ScalesTypeGetWeights () const
 
virtual const bool & GetWeightsAreIdentity () const
 
bool GetScalesInitialized () const
 
virtual void SetScalesEstimator (ScalesEstimatorType *_arg)
 
virtual void SetDoEstimateScales (bool _arg)
 
virtual const bool & GetDoEstimateScales () const
 
virtual void DoEstimateScalesOn ()
 
virtual void DoEstimateScalesOff ()
 
virtual void SetNumberOfWorkUnits (ThreadIdType number)
 
virtual const ThreadIdTypeGetNumberOfWorkUnits () const
 
virtual const ParametersTypeGetCurrentPosition () 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
 
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)
 
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
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::GradientDescentLineSearchOptimizerv4Template< TInternalComputationValueType >
static Pointer New ()
 
- Static Public Member Functions inherited from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >
static Pointer New ()
 
- 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 ()
 

Protected Member Functions

void AdvanceOneStep () override
 
 ConjugateGradientLineSearchOptimizerv4Template ()=default
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~ConjugateGradientLineSearchOptimizerv4Template () override=default
 
- Protected Member Functions inherited from itk::GradientDescentLineSearchOptimizerv4Template< TInternalComputationValueType >
void AdvanceOneStep () override
 
 GradientDescentLineSearchOptimizerv4Template ()
 
 ~GradientDescentLineSearchOptimizerv4Template () override=default
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
TInternalComputationValueType GoldenSectionSearch (TInternalComputationValueType a, TInternalComputationValueType b, TInternalComputationValueType c, TInternalComputationValueType metricb=NumericTraits< TInternalComputationValueType >::max())
 
- Protected Member Functions inherited from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >
void ModifyGradientByScalesOverSubRange (const IndexRangeType &subrange) override
 
void ModifyGradientByLearningRateOverSubRange (const IndexRangeType &subrange) override
 
 GradientDescentOptimizerv4Template ()
 
 ~GradientDescentOptimizerv4Template () override=default
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
- Protected Member Functions inherited from itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >
 GradientDescentOptimizerBasev4Template ()
 
 ~GradientDescentOptimizerBasev4Template () override=default
 
- Protected Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
 ObjectToObjectOptimizerBaseTemplate ()
 
 ~ObjectToObjectOptimizerBaseTemplate () override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
 ~Object () override
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
- 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 ()
 

Private Attributes

DerivativeType m_ConjugateGradient
 
DerivativeType m_LastGradient
 

Additional Inherited Members

- Protected Attributes inherited from itk::GradientDescentLineSearchOptimizerv4Template< TInternalComputationValueType >
TInternalComputationValueType m_LowerLimit
 
TInternalComputationValueType m_UpperLimit
 
TInternalComputationValueType m_Phi
 
TInternalComputationValueType m_Resphi
 
TInternalComputationValueType m_Epsilon
 
unsigned int m_MaximumLineSearchIterations
 
unsigned int m_LineSearchIterations
 
- Protected Attributes inherited from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >
TInternalComputationValueType m_LearningRate
 
TInternalComputationValueType m_MinimumConvergenceValue
 
TInternalComputationValueType m_ConvergenceValue
 
MeasureType m_CurrentBestValue
 
ParametersType m_BestParameters
 
bool m_ReturnBestParametersAndValue { false }
 
DerivativeType m_PreviousGradient
 
- Protected Attributes inherited from itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >
bool m_DoEstimateLearningRateAtEachIteration
 
bool m_DoEstimateLearningRateOnce
 
TInternalComputationValueType m_MaximumStepSizeInPhysicalUnits
 
bool m_UseConvergenceMonitoring
 
SizeValueType m_ConvergenceWindowSize
 
ConvergenceMonitoringType::Pointer m_ConvergenceMonitoring
 
DomainThreader< ThreadedIndexedContainerPartitioner, Self >::Pointer m_ModifyGradientByScalesThreader
 
DomainThreader< ThreadedIndexedContainerPartitioner, Self >::Pointer m_ModifyGradientByLearningRateThreader
 
bool m_Stop { false }
 
StopConditionObjectToObjectOptimizerEnum m_StopCondition
 
StopConditionDescriptionType m_StopConditionDescription
 
DerivativeType m_Gradient
 
- Protected Attributes inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >
MetricTypePointer m_Metric
 
ThreadIdType m_NumberOfWorkUnits
 
SizeValueType m_CurrentIteration
 
SizeValueType m_NumberOfIterations
 
MeasureType m_CurrentMetricValue
 
ScalesType m_Scales
 
ScalesType m_Weights
 
bool m_ScalesAreIdentity
 
ScalesEstimatorType::Pointer m_ScalesEstimator
 
bool m_WeightsAreIdentity
 
bool m_DoEstimateScales
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

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

Conjugate gradient descent optimizer with a golden section line search for nonlinear optimization.

ConjugateGradientLineSearchOptimizer implements a conjugate gradient descent optimizer that is followed by a line search to find the best value for the learning rate. At each iteration the current position is updated according to

\[ p_{n+1} = p_n + \mbox{learningRateByGoldenSectionLineSearch} \, d \]

where d is defined as the Polak-Ribiere conjugate gradient.

Options are identical to the superclass's.

Examples
Examples/RegistrationITKv4/MultiStageImageRegistration1.cxx, and Examples/RegistrationITKv4/MultiStageImageRegistration2.cxx.

Definition at line 48 of file itkConjugateGradientLineSearchOptimizerv4.h.

Member Typedef Documentation

◆ ConstPointer

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

Definition at line 58 of file itkConjugateGradientLineSearchOptimizerv4.h.

◆ ConvergenceMonitoringType

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

Type for the convergence checker

Definition at line 76 of file itkConjugateGradientLineSearchOptimizerv4.h.

◆ DerivativeType

template<typename TInternalComputationValueType >
using itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >::DerivativeType = typename Superclass::DerivativeType

Derivative type

Definition at line 70 of file itkConjugateGradientLineSearchOptimizerv4.h.

◆ InternalComputationValueType

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

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

Definition at line 67 of file itkConjugateGradientLineSearchOptimizerv4.h.

◆ MeasureType

template<typename TInternalComputationValueType >
using itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >::MeasureType = typename Superclass::MeasureType

Metric type over which this class is templated

Definition at line 73 of file itkConjugateGradientLineSearchOptimizerv4.h.

◆ Pointer

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

Definition at line 57 of file itkConjugateGradientLineSearchOptimizerv4.h.

◆ Self

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

Standard class type aliases.

Definition at line 55 of file itkConjugateGradientLineSearchOptimizerv4.h.

◆ Superclass

template<typename TInternalComputationValueType >
using itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >::Superclass = GradientDescentLineSearchOptimizerv4Template<TInternalComputationValueType>

Definition at line 56 of file itkConjugateGradientLineSearchOptimizerv4.h.

Constructor & Destructor Documentation

◆ ConjugateGradientLineSearchOptimizerv4Template()

template<typename TInternalComputationValueType >
itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >::ConjugateGradientLineSearchOptimizerv4Template ( )
protecteddefault

Default constructor

◆ ~ConjugateGradientLineSearchOptimizerv4Template()

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

Destructor

Member Function Documentation

◆ AdvanceOneStep()

template<typename TInternalComputationValueType >
void itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >::AdvanceOneStep ( )
overrideprotectedvirtual

Advance one Step following the gradient direction. Includes transform update.

Reimplemented from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >.

◆ CreateAnother()

template<typename TInternalComputationValueType >
virtual::itk::LightObject::Pointer itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >::CreateAnother ( ) 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::Object.

◆ GetNameOfClass()

template<typename TInternalComputationValueType >
virtual const char* itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::GradientDescentLineSearchOptimizerv4Template< TInternalComputationValueType >.

◆ New()

template<typename TInternalComputationValueType >
static Pointer itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >::New ( )
static

New macro for creation of through a Smart Pointer

◆ PrintSelf()

template<typename TInternalComputationValueType >
void itk::ConjugateGradientLineSearchOptimizerv4Template< 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.

◆ StartOptimization()

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

Run the optimization.

Parameters
doOnlyInitializationThis is false by default. It should only be set to true for special cases when the class should be initialized to perform optimization, but no optimization should be run. For example, itkMultiGradientOptimizerv4 needs to do this.
Note
Derived classes must override and call this superclass method, then perform any additional initialization before performing optimization.

Reimplemented from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >.

Member Data Documentation

◆ m_ConjugateGradient

template<typename TInternalComputationValueType >
DerivativeType itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >::m_ConjugateGradient
private

Definition at line 98 of file itkConjugateGradientLineSearchOptimizerv4.h.

◆ m_LastGradient

template<typename TInternalComputationValueType >
DerivativeType itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >::m_LastGradient
private

Definition at line 97 of file itkConjugateGradientLineSearchOptimizerv4.h.


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