go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes
elastix::PreconditionedGradientDescent< TElastix > Class Template Reference

#include <elxPreconditionedGradientDescent.h>

Detailed Description

template<class TElastix>
class elastix::PreconditionedGradientDescent< TElastix >

A gradient descent optimizer with a decaying gain.

This class is a wrap around the AdaptiveStochasticPreconditionedGradientOptimizer class. It takes care of setting parameters and printing progress information. For more information about the optimization method, please read the documentation of the AdaptiveStochasticPreconditionedGradientOptimizer class.

The parameters used in this class are:

Parameters:

Optimizer: Select this optimizer as follows:
(Optimizer "PreconditionedGradientDescent")

MaximumNumberOfIterations: The maximum number of iterations in each resolution.
example: (MaximumNumberOfIterations 100 100 50)
Default/recommended value: 500.

MaximumNumberOfSamplingAttempts: The maximum number of sampling attempts. Sometimes not enough corresponding samples can be drawn, upon which an exception is thrown. With this parameter it is possible to try to draw another set of samples.
example: (MaximumNumberOfSamplingAttempts 10 15 10)
Default value: 0, i.e. just fail immediately, for backward compatibility.

SP_a: The gain $a(k)$ at each iteration $k$ is defined by
$a(k) =  SP\_a / (SP\_A + k + 1)^{SP\_alpha}$.
SP_a can be defined for each resolution.
example: (SP_a 3200.0 3200.0 1600.0)
The default value is 400.0. Tuning this variable for you specific problem is recommended.

SP_A: The gain $a(k)$ at each iteration $k$ is defined by
$a(k) =  SP\_a / (SP\_A + k + 1)^{SP\_alpha}$.
SP_A can be defined for each resolution.
example: (SP_A 50.0 50.0 100.0)
The default/recommended value is 50.0.

SP_alpha: The gain $a(k)$ at each iteration $k$ is defined by
$a(k) =  SP\_a / (SP\_A + k + 1)^{SP\_alpha}$.
SP_alpha can be defined for each resolution.
example: (SP_alpha 0.602 0.602 0.602)
The default/recommended value is 0.602.

See also
StochasticPreconditionedGradientOptimizer

Definition at line 72 of file elxPreconditionedGradientDescent.h.

Inheritance diagram for elastix::PreconditionedGradientDescent< TElastix >:
Inheritance graph
[legend]

Data Structures

struct  SettingsType
 

Public Types

using ConstPointer = itk::SmartPointer< const Self >
 
using ITKBaseType = typename Superclass2::ITKBaseType
 
using Pointer = itk::SmartPointer< Self >
 
using Self = PreconditionedGradientDescent
 
using Superclass1 = AdaptiveStochasticPreconditionedGradientDescentOptimizer
 
using Superclass2 = OptimizerBase< TElastix >
 
- Public Types inherited from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = AdaptiveStochasticPreconditionedGradientDescentOptimizer
 
using Superclass = StochasticPreconditionedGradientDescentOptimizer
 
- Public Types inherited from itk::StochasticPreconditionedGradientDescentOptimizer
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using PreconditionType = vnl_sparse_matrix< PreconditionValueType >
 
using PreconditionValueType = DerivativeType::ValueType
 
using ScaledCostFunctionPointer = ScaledCostFunctionType::Pointer
 
using ScaledCostFunctionType = ScaledSingleValuedCostFunction
 
using ScalesType = NonLinearOptimizer::ScalesType
 
using Self = StochasticPreconditionedGradientDescentOptimizer
 
enum  StopConditionType
 
using Superclass = PreconditionedGradientDescentOptimizer
 
- Public Types inherited from itk::PreconditionedGradientDescentOptimizer
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using PreconditionType = vnl_sparse_matrix< PreconditionValueType >
 
using PreconditionValueType = DerivativeType::ValueType
 
using ScaledCostFunctionPointer = ScaledCostFunctionType::Pointer
 
using ScaledCostFunctionType = ScaledSingleValuedCostFunction
 
using ScalesType = NonLinearOptimizer::ScalesType
 
using Self = PreconditionedGradientDescentOptimizer
 
enum  StopConditionType { MaximumNumberOfIterations , MetricError , MinimumStepSize }
 
using Superclass = ScaledSingleValuedNonLinearOptimizer
 
- Public Types inherited from itk::ScaledSingleValuedNonLinearOptimizer
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using ScaledCostFunctionPointer = ScaledCostFunctionType::Pointer
 
using ScaledCostFunctionType = ScaledSingleValuedCostFunction
 
using ScalesType = NonLinearOptimizer::ScalesType
 
using Self = ScaledSingleValuedNonLinearOptimizer
 
using Superclass = SingleValuedNonLinearOptimizer
 
- Public Types inherited from elastix::OptimizerBase< TElastix >
using ElastixType = TElastix
 
using ITKBaseType = itk::Optimizer
 
using ParametersType = typename ITKBaseType::ParametersType
 
using RegistrationType = typename ElastixType::RegistrationBaseType
 
using Self = OptimizerBase
 
using Superclass = BaseComponentSE< TElastix >
 
- Public Types inherited from elastix::BaseComponentSE< TElastix >
using ConfigurationPointer = Configuration::Pointer
 
using ElastixType = TElastix
 
using RegistrationType = typename ElastixType::RegistrationBaseType
 
using Self = BaseComponentSE
 
using Superclass = BaseComponent
 

Public Member Functions

virtual void AfterEachIteration ()
 
virtual void AfterEachResolution ()
 
virtual void AfterRegistration ()
 
virtual void BeforeEachResolution ()
 
virtual void BeforeRegistration ()
 
 elxClassNameMacro ("PreconditionedGradientDescent")
 
virtual bool GetAutomaticParameterEstimation () const
 
virtual const char * GetClassName () const
 
virtual const unsigned long & GetMaximumNumberOfSamplingAttempts ()
 
 ITK_DISALLOW_COPY_AND_MOVE (PreconditionedGradientDescent)
 
virtual void MetricErrorResponse (itk::ExceptionObject &err)
 
virtual void ResumeOptimization ()
 
virtual void SetAutomaticParameterEstimation (bool _arg)
 
virtual void SetCurrentPositionPublic (const ParametersType &param)
 
virtual void SetMaximumNumberOfSamplingAttempts (unsigned long _arg)
 
virtual void StartOptimization ()
 
- Public Member Functions inherited from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer
virtual const char * GetClassName () const
 
virtual double GetSigmoidMax () const
 
virtual double GetSigmoidMin () const
 
virtual double GetSigmoidScale () const
 
virtual bool GetUseAdaptiveStepSizes () const
 
 ITK_DISALLOW_COPY_AND_MOVE (AdaptiveStochasticPreconditionedGradientDescentOptimizer)
 
virtual void SetSigmoidMax (double _arg)
 
virtual void SetSigmoidMin (double _arg)
 
virtual void SetSigmoidScale (double _arg)
 
virtual void SetUseAdaptiveStepSizes (bool _arg)
 
- Public Member Functions inherited from itk::StochasticPreconditionedGradientDescentOptimizer
virtual void AdvanceOneStep ()
 
virtual const char * GetClassName () const
 
virtual double GetCurrentTime () const
 
virtual double GetInitialTime () const
 
virtual double GetParam_a () const
 
virtual double GetParam_A () const
 
virtual double GetParam_alpha () const
 
 ITK_DISALLOW_COPY_AND_MOVE (StochasticPreconditionedGradientDescentOptimizer)
 
virtual void SetInitialTime (double _arg)
 
virtual void SetParam_a (double _arg)
 
virtual void SetParam_A (double _arg)
 
virtual void SetParam_alpha (double _arg)
 
virtual void StartOptimization ()
 
- Public Member Functions inherited from itk::PreconditionedGradientDescentOptimizer
virtual void AdvanceOneStep ()
 
const cholmod_common * GetCholmodCommon () const
 
const cholmod_factor * GetCholmodFactor () const
 
virtual const char * GetClassName () const
 
virtual double GetConditionNumber () const
 
virtual unsigned int GetCurrentIteration () const
 
virtual double GetDiagonalWeight () const
 
virtual const DerivativeType & GetGradient ()
 
virtual double GetLargestEigenValue () const
 
virtual const doubleGetLearningRate ()
 
virtual double GetMinimumGradientElementMagnitude () const
 
virtual const unsigned long & GetNumberOfIterations ()
 
virtual const DerivativeType & GetSearchDirection ()
 
virtual double GetSparsity () const
 
virtual const StopConditionTypeGetStopCondition ()
 
virtual const doubleGetValue ()
 
 ITK_DISALLOW_COPY_AND_MOVE (PreconditionedGradientDescentOptimizer)
 
virtual void MetricErrorResponse (ExceptionObject &err)
 
virtual void ResumeOptimization ()
 
virtual void SetDiagonalWeight (double _arg)
 
virtual void SetLearningRate (double _arg)
 
virtual void SetMinimumGradientElementMagnitude (double _arg)
 
virtual void SetNumberOfIterations (unsigned long _arg)
 
virtual void SetPreconditionMatrix (PreconditionType &precondition)
 
virtual void StartOptimization ()
 
virtual void StopOptimization ()
 
- Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
virtual const char * GetClassName () const
 
const ParametersType & GetCurrentPosition () const override
 
virtual bool GetMaximize () const
 
virtual const ScaledCostFunctionTypeGetScaledCostFunction ()
 
virtual const ParametersType & GetScaledCurrentPosition ()
 
bool GetUseScales () const
 
virtual void InitializeScales ()
 
 ITK_DISALLOW_COPY_AND_MOVE (ScaledSingleValuedNonLinearOptimizer)
 
virtual void MaximizeOff ()
 
virtual void MaximizeOn ()
 
void SetCostFunction (CostFunctionType *costFunction) override
 
virtual void SetMaximize (bool _arg)
 
virtual void SetUseScales (bool arg)
 
- Public Member Functions inherited from elastix::OptimizerBase< TElastix >
void AfterRegistrationBase () override
 
void BeforeEachResolutionBase () override
 
ITKBaseTypeGetAsITKBaseType ()
 
const ITKBaseTypeGetAsITKBaseType () const
 
virtual const char * GetClassName () const
 
 ITK_DISALLOW_COPY_AND_MOVE (OptimizerBase)
 
virtual void SetCurrentPositionPublic (const ParametersType &param)
 
virtual void SetSinusScales (double amplitude, double frequency, unsigned long numberOfParameters)
 
- Public Member Functions inherited from elastix::BaseComponentSE< TElastix >
void AddTargetCellToIterationInfo (const char *const name)
 
ConfigurationGetConfiguration () const
 
ElastixTypeGetElastix () const
 
xl::xoutbaseGetIterationInfoAt (const char *const name)
 
RegistrationTypeGetRegistration () const
 
 ITK_DISALLOW_COPY_AND_MOVE (BaseComponentSE)
 
int RemoveTargetCellFromIterationInfo (const char *const name)
 
void SetConfiguration (Configuration *_arg)
 
void SetElastix (ElastixType *_arg)
 
- Public Member Functions inherited from elastix::BaseComponent
virtual void AfterEachIteration ()
 
virtual void AfterEachIterationBase ()
 
virtual void AfterEachResolution ()
 
virtual void AfterEachResolutionBase ()
 
virtual void AfterRegistration ()
 
virtual void AfterRegistrationBase ()
 
virtual int BeforeAll ()
 
virtual int BeforeAllBase ()
 
virtual void BeforeEachResolution ()
 
virtual void BeforeEachResolutionBase ()
 
virtual void BeforeRegistration ()
 
virtual void BeforeRegistrationBase ()
 
virtual const char * elxGetClassName () const
 
const char * GetComponentLabel () const
 
 ITK_DISALLOW_COPY_AND_MOVE (BaseComponent)
 
 itkTypeMacroNoParent (BaseComponent)
 
void SetComponentLabel (const char *label, unsigned int idx)
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::StochasticPreconditionedGradientDescentOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::PreconditionedGradientDescentOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from elastix::BaseComponent
template<typename TBaseComponent >
static auto AsITKBaseType (TBaseComponent *const baseComponent) -> decltype(baseComponent->GetAsITKBaseType())
 
static void InitializeElastixExecutable ()
 
static bool IsElastixLibrary ()
 

Protected Types

using FixedImageType = typename RegistrationType::FixedImageType
 
using ImageGridSamplerPointer = typename ImageGridSamplerType::Pointer
 
using ImageGridSamplerType = itk::ImageGridSampler< FixedImageType >
 
using ImageRandomCoordinateSamplerPointer = typename ImageRandomCoordinateSamplerType::Pointer
 
using ImageRandomCoordinateSamplerType = itk::ImageRandomCoordinateSampler< FixedImageType >
 
using ImageRandomSamplerBasePointer = typename ImageRandomSamplerBaseType::Pointer
 
using ImageRandomSamplerBaseType = itk::ImageRandomSamplerBase< FixedImageType >
 
using ImageSamplerBasePointer = typename ImageSamplerBaseType::Pointer
 
using ImageSamplerBaseType = itk::ImageSamplerBase< FixedImageType >
 
using MovingImageType = typename RegistrationType::MovingImageType
 
using ProgressCommandPointer = typename ProgressCommand::Pointer
 
using ProgressCommandType = ProgressCommand
 
using RandomGeneratorPointer = typename RandomGeneratorType::Pointer
 
using RandomGeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator
 
using SettingsVectorType = typename std::vector< SettingsType >
 
- Protected Types inherited from itk::PreconditionedGradientDescentOptimizer
using cholmod_l = int CInt
 

Protected Member Functions

virtual void AddRandomPerturbation (const ParametersType &initialParameters, ParametersType &perturbedParameters, double sigma)
 
virtual void AutomaticParameterEstimation ()
 
virtual void GetScaledDerivativeWithExceptionHandling (const ParametersType &parameters, DerivativeType &derivative)
 
 PreconditionedGradientDescent ()
 
virtual void PrintSettingsVector (const SettingsVectorType &settings) const
 
virtual void SampleGradients (const ParametersType &mu0, double &sigma1, double &sigma2)
 
virtual void SetSelfHessian ()
 
virtual ~PreconditionedGradientDescent ()
 
- Protected Member Functions inherited from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer
 AdaptiveStochasticPreconditionedGradientDescentOptimizer ()
 
virtual void UpdateCurrentTime ()
 
virtual ~AdaptiveStochasticPreconditionedGradientDescentOptimizer ()
 
- Protected Member Functions inherited from itk::StochasticPreconditionedGradientDescentOptimizer
virtual double Compute_a (double k) const
 
 StochasticPreconditionedGradientDescentOptimizer ()
 
virtual void UpdateCurrentTime ()
 
virtual ~StochasticPreconditionedGradientDescentOptimizer ()
 
- Protected Member Functions inherited from itk::PreconditionedGradientDescentOptimizer
virtual void CholmodSolve (const DerivativeType &gradient, DerivativeType &searchDirection, int solveType=CHOLMOD_A)
 
 PreconditionedGradientDescentOptimizer ()
 
void PrintSelf (std::ostream &os, Indent indent) const
 
virtual ~PreconditionedGradientDescentOptimizer ()
 
- Protected Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
virtual void GetScaledDerivative (const ParametersType &parameters, DerivativeType &derivative) const
 
virtual MeasureType GetScaledValue (const ParametersType &parameters) const
 
virtual void GetScaledValueAndDerivative (const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ScaledSingleValuedNonLinearOptimizer ()
 
void SetCurrentPosition (const ParametersType &param) override
 
virtual void SetScaledCurrentPosition (const ParametersType &parameters)
 
 ~ScaledSingleValuedNonLinearOptimizer () override=default
 
- Protected Member Functions inherited from elastix::OptimizerBase< TElastix >
virtual bool GetNewSamplesEveryIteration () const
 
 OptimizerBase ()=default
 
virtual void SelectNewSamples ()
 
 ~OptimizerBase () override=default
 
- Protected Member Functions inherited from elastix::BaseComponentSE< TElastix >
 BaseComponentSE ()=default
 
 ~BaseComponentSE () override=default
 
- Protected Member Functions inherited from elastix::BaseComponent
 BaseComponent ()=default
 
virtual ~BaseComponent ()=default
 

Protected Attributes

unsigned int m_NumberOfGradientMeasurements
 
unsigned int m_NumberOfSamplesForExactGradient
 
RandomGeneratorPointer m_RandomGenerator
 
SettingsVectorType m_SettingsVector
 
double m_SigmoidScaleFactor
 
- Protected Attributes inherited from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer
DerivativeType m_PreviousSearchDirection
 
- Protected Attributes inherited from itk::StochasticPreconditionedGradientDescentOptimizer
double m_CurrentTime { 0.0 }
 
- Protected Attributes inherited from itk::PreconditionedGradientDescentOptimizer
cholmod_common * m_CholmodCommon
 
cholmod_factor * m_CholmodFactor { nullptr }
 
cholmod_sparse * m_CholmodGradient { nullptr }
 
double m_ConditionNumber { 1.0 }
 
DerivativeType m_Gradient
 
double m_LargestEigenValue { 1.0 }
 
double m_LearningRate { 1.0 }
 
DerivativeType m_SearchDirection
 
double m_Sparsity { 1.0 }
 
StopConditionType m_StopCondition { MaximumNumberOfIterations }
 
- Protected Attributes inherited from itk::ScaledSingleValuedNonLinearOptimizer
ScaledCostFunctionPointer m_ScaledCostFunction
 
ParametersType m_ScaledCurrentPosition
 
- Protected Attributes inherited from elastix::BaseComponentSE< TElastix >
ConfigurationPointer m_Configuration {}
 
itk::WeakPointer< TElastix > m_Elastix {}
 
RegistrationTypem_Registration {}
 

Private Attributes

 elxOverrideGetSelfMacro
 
bool m_AutomaticParameterEstimation
 
bool m_AutomaticParameterEstimationDone
 
unsigned long m_CurrentNumberOfSamplingAttempts
 
unsigned long m_MaximumNumberOfSamplingAttempts
 
bool m_PreconditionMatrixSet
 
unsigned long m_PreviousErrorAtIteration
 

Member Typedef Documentation

◆ ConstPointer

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ConstPointer = itk::SmartPointer<const Self>

Definition at line 84 of file elxPreconditionedGradientDescent.h.

◆ FixedImageType

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::FixedImageType = typename RegistrationType::FixedImageType
protected

Samplers:

Definition at line 190 of file elxPreconditionedGradientDescent.h.

◆ ImageGridSamplerPointer

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ImageGridSamplerPointer = typename ImageGridSamplerType::Pointer
protected

Definition at line 199 of file elxPreconditionedGradientDescent.h.

◆ ImageGridSamplerType

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ImageGridSamplerType = itk::ImageGridSampler<FixedImageType>
protected

Definition at line 198 of file elxPreconditionedGradientDescent.h.

◆ ImageRandomCoordinateSamplerPointer

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ImageRandomCoordinateSamplerPointer = typename ImageRandomCoordinateSamplerType::Pointer
protected

Definition at line 197 of file elxPreconditionedGradientDescent.h.

◆ ImageRandomCoordinateSamplerType

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ImageRandomCoordinateSamplerType = itk::ImageRandomCoordinateSampler<FixedImageType>
protected

Definition at line 196 of file elxPreconditionedGradientDescent.h.

◆ ImageRandomSamplerBasePointer

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ImageRandomSamplerBasePointer = typename ImageRandomSamplerBaseType::Pointer
protected

Definition at line 195 of file elxPreconditionedGradientDescent.h.

◆ ImageRandomSamplerBaseType

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ImageRandomSamplerBaseType = itk::ImageRandomSamplerBase<FixedImageType>
protected

Definition at line 194 of file elxPreconditionedGradientDescent.h.

◆ ImageSamplerBasePointer

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ImageSamplerBasePointer = typename ImageSamplerBaseType::Pointer
protected

Definition at line 193 of file elxPreconditionedGradientDescent.h.

◆ ImageSamplerBaseType

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ImageSamplerBaseType = itk::ImageSamplerBase<FixedImageType>
protected

Definition at line 192 of file elxPreconditionedGradientDescent.h.

◆ ITKBaseType

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ITKBaseType = typename Superclass2::ITKBaseType

Definition at line 106 of file elxPreconditionedGradientDescent.h.

◆ MovingImageType

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::MovingImageType = typename RegistrationType::MovingImageType
protected

Definition at line 191 of file elxPreconditionedGradientDescent.h.

◆ Pointer

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::Pointer = itk::SmartPointer<Self>

Definition at line 83 of file elxPreconditionedGradientDescent.h.

◆ ProgressCommandPointer

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ProgressCommandPointer = typename ProgressCommand::Pointer
protected

Definition at line 187 of file elxPreconditionedGradientDescent.h.

◆ ProgressCommandType

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::ProgressCommandType = ProgressCommand
protected

Definition at line 186 of file elxPreconditionedGradientDescent.h.

◆ RandomGeneratorPointer

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::RandomGeneratorPointer = typename RandomGeneratorType::Pointer
protected

Definition at line 185 of file elxPreconditionedGradientDescent.h.

◆ RandomGeneratorType

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::RandomGeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator
protected

Other protected typedefs

Definition at line 184 of file elxPreconditionedGradientDescent.h.

◆ Self

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::Self = PreconditionedGradientDescent

Standard ITK.

Definition at line 80 of file elxPreconditionedGradientDescent.h.

◆ SettingsVectorType

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::SettingsVectorType = typename std::vector<SettingsType>
protected

Definition at line 181 of file elxPreconditionedGradientDescent.h.

◆ Superclass1

Definition at line 81 of file elxPreconditionedGradientDescent.h.

◆ Superclass2

template<class TElastix >
using elastix::PreconditionedGradientDescent< TElastix >::Superclass2 = OptimizerBase<TElastix>

Definition at line 82 of file elxPreconditionedGradientDescent.h.

Constructor & Destructor Documentation

◆ PreconditionedGradientDescent()

template<class TElastix >
elastix::PreconditionedGradientDescent< TElastix >::PreconditionedGradientDescent ( )
protected

◆ ~PreconditionedGradientDescent()

template<class TElastix >
virtual elastix::PreconditionedGradientDescent< TElastix >::~PreconditionedGradientDescent ( )
inlineprotectedvirtual

Definition at line 202 of file elxPreconditionedGradientDescent.h.

Member Function Documentation

◆ AddRandomPerturbation()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::AddRandomPerturbation ( const ParametersType initialParameters,
ParametersType perturbedParameters,
double  sigma 
)
protectedvirtual

Helper function that adds a random perturbation delta to the input parameters, with delta ~ sigma * N(0,I). Used by SampleGradients.

◆ AfterEachIteration()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::AfterEachIteration ( )
virtual

Reimplemented from elastix::BaseComponent.

◆ AfterEachResolution()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::AfterEachResolution ( )
virtual

Reimplemented from elastix::BaseComponent.

◆ AfterRegistration()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::AfterRegistration ( )
virtual

Reimplemented from elastix::BaseComponent.

◆ AutomaticParameterEstimation()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::AutomaticParameterEstimation ( )
protectedvirtual

Estimates some reasonable values for the parameters SP_a, SP_alpha (=1), SigmoidMin, SigmoidMax (=1), and SigmoidScale.

◆ BeforeEachResolution()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::BeforeEachResolution ( )
virtual

Reimplemented from elastix::BaseComponent.

◆ BeforeRegistration()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::BeforeRegistration ( )
virtual

Methods invoked by elastix, in which parameters can be set and progress information can be printed.

Reimplemented from elastix::BaseComponent.

◆ elxClassNameMacro()

template<class TElastix >
elastix::PreconditionedGradientDescent< TElastix >::elxClassNameMacro ( "PreconditionedGradientDescent< TElastix >"  )

Name of this class. Use this name in the parameter file to select this specific optimizer. example: (Optimizer "PreconditionedGradientDescent")

◆ GetAutomaticParameterEstimation()

template<class TElastix >
virtual bool elastix::PreconditionedGradientDescent< TElastix >::GetAutomaticParameterEstimation ( ) const
virtual

◆ GetClassName()

template<class TElastix >
virtual const char * elastix::PreconditionedGradientDescent< TElastix >::GetClassName ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer.

◆ GetMaximumNumberOfSamplingAttempts()

template<class TElastix >
virtual const unsigned long & elastix::PreconditionedGradientDescent< TElastix >::GetMaximumNumberOfSamplingAttempts ( )
virtual

Get the MaximumNumberOfSamplingAttempts.

◆ GetScaledDerivativeWithExceptionHandling()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::GetScaledDerivativeWithExceptionHandling ( const ParametersType parameters,
DerivativeType &  derivative 
)
protectedvirtual

Helper function, which calls GetScaledValueAndDerivative and does some exception handling. Used by SampleGradients.

◆ ITK_DISALLOW_COPY_AND_MOVE()

template<class TElastix >
elastix::PreconditionedGradientDescent< TElastix >::ITK_DISALLOW_COPY_AND_MOVE ( PreconditionedGradientDescent< TElastix >  )

◆ MetricErrorResponse()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::MetricErrorResponse ( itk::ExceptionObject &  err)
virtual

Stop optimization and pass on exception.

◆ New()

template<class TElastix >
static Pointer elastix::PreconditionedGradientDescent< TElastix >::New ( )
static

Method for creation through the object factory.

◆ PrintSettingsVector()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::PrintSettingsVector ( const SettingsVectorType settings) const
protectedvirtual

Print the contents of the settings vector to elxout.

◆ ResumeOptimization()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::ResumeOptimization ( )
virtual

Set the SelfHessian as a preconditioning matrix and call Superclass' implementation. Only done when m_PreconditionMatrixSet == false; If automatic gain estimation is desired, then estimate SP_a, SP_alpha SigmoidScale, SigmoidMax, SigmoidMin. After that call Superclass' implementation.

Reimplemented from itk::PreconditionedGradientDescentOptimizer.

◆ SampleGradients()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::SampleGradients ( const ParametersType mu0,
double sigma1,
double sigma2 
)
protectedvirtual

Measure some derivatives, exact and approximated. Returns the sigma1 and sigma2. Needed for the automatic parameter estimation. Gradients are measured at position mu_n, which are generated according to: mu_n - mu_0 ~ N(0, perturbationSigma P ); perturbationSigma = sigma1 = 1/N g_0' P g_0, where g_0 is the exact gradient at mu_0, and N the number of parameters. sigma2 = 1/N sum_n g_n' P g_n / (sum_n n), where g_n is the approximated gradient at mu_0. NB: sigma1 = sqr(sigma_1), sigma2 = sqr(sigma_2), compared to my notes.

◆ SetAutomaticParameterEstimation()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::SetAutomaticParameterEstimation ( bool  _arg)
virtual

Set/Get whether automatic parameter estimation is desired. If true, make sure to set the maximum step length.

The following parameters are automatically determined: SP_a = 2*SP_A, SP_alpha (=1), SigmoidMin, SigmoidMax (=1), SigmoidScale. A usually suitable value for SP_A is 20, which is the default setting, if not specified by the user.

◆ SetCurrentPositionPublic()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::SetCurrentPositionPublic ( const ParametersType param)
inlinevirtual

Add SetCurrentPositionPublic, which calls the protected SetCurrentPosition of the itkAdaptiveStochasticPreconditionedGradientDescentOptimizer class.

Reimplemented from elastix::OptimizerBase< TElastix >.

Definition at line 144 of file elxPreconditionedGradientDescent.h.

◆ SetMaximumNumberOfSamplingAttempts()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::SetMaximumNumberOfSamplingAttempts ( unsigned long  _arg)
virtual

Set the MaximumNumberOfSamplingAttempts.

◆ SetSelfHessian()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::SetSelfHessian ( )
protectedvirtual

Get the SelfHessian from the metric and submit as Precondition matrix

◆ StartOptimization()

template<class TElastix >
virtual void elastix::PreconditionedGradientDescent< TElastix >::StartOptimization ( )
virtual

Check if any scales are set, and set the UseScales flag on or off; after that call the superclass' implementation.

Reimplemented from itk::StochasticPreconditionedGradientDescentOptimizer.

Field Documentation

◆ elxOverrideGetSelfMacro

template<class TElastix >
elastix::PreconditionedGradientDescent< TElastix >::elxOverrideGetSelfMacro
private

Definition at line 255 of file elxPreconditionedGradientDescent.h.

◆ m_AutomaticParameterEstimation

template<class TElastix >
bool elastix::PreconditionedGradientDescent< TElastix >::m_AutomaticParameterEstimation
private

Definition at line 265 of file elxPreconditionedGradientDescent.h.

◆ m_AutomaticParameterEstimationDone

template<class TElastix >
bool elastix::PreconditionedGradientDescent< TElastix >::m_AutomaticParameterEstimationDone
private

Definition at line 266 of file elxPreconditionedGradientDescent.h.

◆ m_CurrentNumberOfSamplingAttempts

template<class TElastix >
unsigned long elastix::PreconditionedGradientDescent< TElastix >::m_CurrentNumberOfSamplingAttempts
private

Definition at line 259 of file elxPreconditionedGradientDescent.h.

◆ m_MaximumNumberOfSamplingAttempts

template<class TElastix >
unsigned long elastix::PreconditionedGradientDescent< TElastix >::m_MaximumNumberOfSamplingAttempts
private

Private variables for the sampling attempts.

Definition at line 258 of file elxPreconditionedGradientDescent.h.

◆ m_NumberOfGradientMeasurements

template<class TElastix >
unsigned int elastix::PreconditionedGradientDescent< TElastix >::m_NumberOfGradientMeasurements
protected

Definition at line 207 of file elxPreconditionedGradientDescent.h.

◆ m_NumberOfSamplesForExactGradient

template<class TElastix >
unsigned int elastix::PreconditionedGradientDescent< TElastix >::m_NumberOfSamplesForExactGradient
protected

Definition at line 208 of file elxPreconditionedGradientDescent.h.

◆ m_PreconditionMatrixSet

template<class TElastix >
bool elastix::PreconditionedGradientDescent< TElastix >::m_PreconditionMatrixSet
private

Private variables for self Hessian support.

Definition at line 263 of file elxPreconditionedGradientDescent.h.

◆ m_PreviousErrorAtIteration

template<class TElastix >
unsigned long elastix::PreconditionedGradientDescent< TElastix >::m_PreviousErrorAtIteration
private

Definition at line 260 of file elxPreconditionedGradientDescent.h.

◆ m_RandomGenerator

template<class TElastix >
RandomGeneratorPointer elastix::PreconditionedGradientDescent< TElastix >::m_RandomGenerator
protected

RandomGenerator for AddRandomPerturbation.

Definition at line 212 of file elxPreconditionedGradientDescent.h.

◆ m_SettingsVector

template<class TElastix >
SettingsVectorType elastix::PreconditionedGradientDescent< TElastix >::m_SettingsVector
protected

Variable to store the automatically determined settings for each resolution.

Definition at line 205 of file elxPreconditionedGradientDescent.h.

◆ m_SigmoidScaleFactor

template<class TElastix >
double elastix::PreconditionedGradientDescent< TElastix >::m_SigmoidScaleFactor
protected

Definition at line 209 of file elxPreconditionedGradientDescent.h.



Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo