![]() |
Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
A gradient descent optimizer with an adaptive gain. More...
#include <elxAdaptiveStochasticGradientDescent.h>
A gradient descent optimizer with an adaptive gain.
This class is a wrap around the AdaptiveStochasticGradientDescentOptimizer class. It takes care of setting parameters and printing progress information. For more information about the optimization method, please read the documentation of the AdaptiveStochasticGradientDescentOptimizer class.
This optimizer is very suitable to be used in combination with the Random image sampler, or with the RandomCoordinate image sampler, with the setting (NewSamplesEveryIteration "true"). Much effort has been spent on providing reasonable default values for all parameters, to simplify usage. In most registration problems, good results should be obtained without specifying any of the parameters described below (except the first of course, which defines the optimizer to use).
This optimization method is described in the following references:
[1] P. Cruz, "Almost sure convergence and asymptotical normality of a generalization of Kesten's stochastic approximation algorithm for multidimensional case." Technical Report, 2005. http://hdl.handle.net/2052/74
[2] S. Klein, J.P.W. Pluim, and M. Staring, M.A. Viergever, "Adaptive stochastic gradient descent optimisation for image registration," International Journal of Computer Vision, vol. 81, no. 3, pp. 227-239, 2009. http://dx.doi.org/10.1007/s11263-008-0168-y
The parameters used in this class are:
(Optimizer "AdaptiveStochasticGradientDescent")
(MaximumNumberOfIterations 100 100 50)
(MaximumNumberOfSamplingAttempts 10 15 10)
(AutomaticParameterEstimation "true")
(UseAdaptiveStepSizes "true")
(MaximumStepLength 1.0)
(SP_a 3200.0 3200.0 1600.0)
(SP_A 50.0 50.0 100.0)
(SP_alpha 0.602 0.602 0.602)
(SigmoidMax 1.0)
(SigmoidMin -0.8)
(SigmoidScale 0.00001)
(SigmoidInitialTime 0.0 5.0 5.0)
(NumberOfGradientMeasurements 10)
(NumberOfJacobianMeasurements 5000 10000 20000)
(NumberOfSamplesForExactGradient 100000)
Definition at line 169 of file elxAdaptiveStochasticGradientDescent.h.
typedef AdvancedTransform< CoordinateRepresentationType, itkGetStaticConstMacro(FixedImageDimension), itkGetStaticConstMacro(MovingImageDimension) > elastix::AdaptiveStochasticGradientDescent< TElastix >::AdvancedTransformType [protected] |
Definition at line 301 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass2::ConfigurationPointer elastix::AdaptiveStochasticGradientDescent< TElastix >::ConfigurationPointer |
Reimplemented from elastix::OptimizerBase< TElastix >.
Definition at line 204 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass2::ConfigurationType elastix::AdaptiveStochasticGradientDescent< TElastix >::ConfigurationType |
Reimplemented from elastix::OptimizerBase< TElastix >.
Definition at line 203 of file elxAdaptiveStochasticGradientDescent.h.
typedef SmartPointer<const Self> elastix::AdaptiveStochasticGradientDescent< TElastix >::ConstPointer |
Reimplemented from itk::AdaptiveStochasticGradientDescentOptimizer.
Definition at line 180 of file elxAdaptiveStochasticGradientDescent.h.
typedef TransformType::ScalarType elastix::AdaptiveStochasticGradientDescent< TElastix >::CoordinateRepresentationType [protected] |
Definition at line 297 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass1::CostFunctionPointer elastix::AdaptiveStochasticGradientDescent< TElastix >::CostFunctionPointer |
Definition at line 197 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass1::CostFunctionType elastix::AdaptiveStochasticGradientDescent< TElastix >::CostFunctionType |
Typedef's inherited from Superclass1.
Reimplemented from itk::AdaptiveStochasticGradientDescentOptimizer.
Definition at line 196 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass2::ElastixPointer elastix::AdaptiveStochasticGradientDescent< TElastix >::ElastixPointer |
Reimplemented from elastix::OptimizerBase< TElastix >.
Definition at line 202 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass2::ElastixType elastix::AdaptiveStochasticGradientDescent< TElastix >::ElastixType |
Typedef's inherited from Superclass2.
Reimplemented from elastix::OptimizerBase< TElastix >.
Definition at line 201 of file elxAdaptiveStochasticGradientDescent.h.
typedef FixedImageType::IndexType elastix::AdaptiveStochasticGradientDescent< TElastix >::FixedImageIndexType [protected] |
Definition at line 263 of file elxAdaptiveStochasticGradientDescent.h.
typedef FixedImageType::PointType elastix::AdaptiveStochasticGradientDescent< TElastix >::FixedImagePointType [protected] |
Definition at line 264 of file elxAdaptiveStochasticGradientDescent.h.
typedef FixedImageType::RegionType elastix::AdaptiveStochasticGradientDescent< TElastix >::FixedImageRegionType [protected] |
Definition at line 262 of file elxAdaptiveStochasticGradientDescent.h.
typedef RegistrationType::FixedImageType elastix::AdaptiveStochasticGradientDescent< TElastix >::FixedImageType [protected] |
Protected typedefs
Definition at line 255 of file elxAdaptiveStochasticGradientDescent.h.
typedef ImageGridSamplerType::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageGridSamplerPointer [protected] |
Definition at line 283 of file elxAdaptiveStochasticGradientDescent.h.
typedef ImageGridSampler< FixedImageType > elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageGridSamplerType [protected] |
Definition at line 282 of file elxAdaptiveStochasticGradientDescent.h.
typedef ImageRandomCoordinateSamplerType::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageRandomCoordinateSamplerPointer [protected] |
Definition at line 281 of file elxAdaptiveStochasticGradientDescent.h.
typedef itk::ImageRandomCoordinateSampler<FixedImageType> elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageRandomCoordinateSamplerType [protected] |
Definition at line 279 of file elxAdaptiveStochasticGradientDescent.h.
typedef ImageRandomSamplerBaseType::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageRandomSamplerBasePointer [protected] |
Definition at line 277 of file elxAdaptiveStochasticGradientDescent.h.
typedef itk::ImageRandomSamplerBase<FixedImageType> elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageRandomSamplerBaseType [protected] |
Definition at line 275 of file elxAdaptiveStochasticGradientDescent.h.
typedef ImageSampleContainerType::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageSampleContainerPointer [protected] |
Definition at line 286 of file elxAdaptiveStochasticGradientDescent.h.
typedef ImageGridSamplerType::ImageSampleContainerType elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageSampleContainerType [protected] |
Definition at line 285 of file elxAdaptiveStochasticGradientDescent.h.
typedef ImageSamplerBaseType::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageSamplerBasePointer [protected] |
Definition at line 274 of file elxAdaptiveStochasticGradientDescent.h.
typedef itk::ImageSamplerBase<FixedImageType> elastix::AdaptiveStochasticGradientDescent< TElastix >::ImageSamplerBaseType [protected] |
Samplers:
Definition at line 273 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass2::ITKBaseType elastix::AdaptiveStochasticGradientDescent< TElastix >::ITKBaseType |
Reimplemented from elastix::OptimizerBase< TElastix >.
Definition at line 207 of file elxAdaptiveStochasticGradientDescent.h.
typedef RegistrationType::ITKBaseType elastix::AdaptiveStochasticGradientDescent< TElastix >::itkRegistrationType [protected] |
Definition at line 265 of file elxAdaptiveStochasticGradientDescent.h.
typedef TransformType::JacobianType elastix::AdaptiveStochasticGradientDescent< TElastix >::JacobianType [protected] |
Definition at line 267 of file elxAdaptiveStochasticGradientDescent.h.
typedef JacobianType::ValueType elastix::AdaptiveStochasticGradientDescent< TElastix >::JacobianValueType [protected] |
Definition at line 268 of file elxAdaptiveStochasticGradientDescent.h.
typedef RegistrationType::MovingImageType elastix::AdaptiveStochasticGradientDescent< TElastix >::MovingImageType [protected] |
Definition at line 261 of file elxAdaptiveStochasticGradientDescent.h.
typedef AdvancedTransformType::NonZeroJacobianIndicesType elastix::AdaptiveStochasticGradientDescent< TElastix >::NonZeroJacobianIndicesType [protected] |
Definition at line 303 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass1::ParametersType elastix::AdaptiveStochasticGradientDescent< TElastix >::ParametersType |
Typedef for the ParametersType.
Reimplemented from itk::AdaptiveStochasticGradientDescentOptimizer.
Definition at line 210 of file elxAdaptiveStochasticGradientDescent.h.
typedef SmartPointer<Self> elastix::AdaptiveStochasticGradientDescent< TElastix >::Pointer |
Reimplemented from itk::AdaptiveStochasticGradientDescentOptimizer.
Definition at line 179 of file elxAdaptiveStochasticGradientDescent.h.
typedef ProgressCommand::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::ProgressCommandPointer [protected] |
Definition at line 291 of file elxAdaptiveStochasticGradientDescent.h.
typedef ProgressCommand elastix::AdaptiveStochasticGradientDescent< TElastix >::ProgressCommandType [protected] |
Definition at line 290 of file elxAdaptiveStochasticGradientDescent.h.
typedef itk::Statistics::MersenneTwisterRandomVariateGenerator elastix::AdaptiveStochasticGradientDescent< TElastix >::RandomGeneratorType [protected] |
Other protected typedefs
Definition at line 289 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass2::RegistrationPointer elastix::AdaptiveStochasticGradientDescent< TElastix >::RegistrationPointer |
Reimplemented from elastix::OptimizerBase< TElastix >.
Definition at line 206 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass2::RegistrationType elastix::AdaptiveStochasticGradientDescent< TElastix >::RegistrationType |
Reimplemented from elastix::OptimizerBase< TElastix >.
Definition at line 205 of file elxAdaptiveStochasticGradientDescent.h.
typedef AdaptiveStochasticGradientDescent elastix::AdaptiveStochasticGradientDescent< TElastix >::Self |
Standard ITK.
Reimplemented from itk::AdaptiveStochasticGradientDescentOptimizer.
Definition at line 176 of file elxAdaptiveStochasticGradientDescent.h.
typedef std::vector<SettingsType> elastix::AdaptiveStochasticGradientDescent< TElastix >::SettingsVectorType [protected] |
Definition at line 270 of file elxAdaptiveStochasticGradientDescent.h.
typedef Superclass1::StopConditionType elastix::AdaptiveStochasticGradientDescent< TElastix >::StopConditionType |
Reimplemented from itk::AdaptiveStochasticGradientDescentOptimizer.
Definition at line 198 of file elxAdaptiveStochasticGradientDescent.h.
typedef AdaptiveStochasticGradientDescentOptimizer elastix::AdaptiveStochasticGradientDescent< TElastix >::Superclass1 |
Definition at line 177 of file elxAdaptiveStochasticGradientDescent.h.
typedef OptimizerBase<TElastix> elastix::AdaptiveStochasticGradientDescent< TElastix >::Superclass2 |
Definition at line 178 of file elxAdaptiveStochasticGradientDescent.h.
typedef JacobianType elastix::AdaptiveStochasticGradientDescent< TElastix >::TransformJacobianType [protected] |
Typedefs for support of sparse Jacobians and AdvancedTransforms.
Definition at line 294 of file elxAdaptiveStochasticGradientDescent.h.
typedef itkRegistrationType::TransformType elastix::AdaptiveStochasticGradientDescent< TElastix >::TransformType [protected] |
Definition at line 266 of file elxAdaptiveStochasticGradientDescent.h.
elastix::AdaptiveStochasticGradientDescent< TElastix >::AdaptiveStochasticGradientDescent | ( | ) | [protected] |
virtual elastix::AdaptiveStochasticGradientDescent< TElastix >::~AdaptiveStochasticGradientDescent | ( | ) | [inline, protected, virtual] |
Definition at line 306 of file elxAdaptiveStochasticGradientDescent.h.
elastix::AdaptiveStochasticGradientDescent< TElastix >::AdaptiveStochasticGradientDescent | ( | const Self & | ) | [private] |
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::AddRandomPerturbation | ( | ParametersType & | parameters, |
double | sigma | ||
) | [protected, virtual] |
Helper function that adds a random perturbation delta to the input parameters, with delta ~ sigma * N(0,I). Used by SampleGradients.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::AfterEachIteration | ( | void | ) | [virtual] |
Reimplemented from elastix::BaseComponent.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::AfterEachResolution | ( | void | ) | [virtual] |
Reimplemented from elastix::BaseComponent.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::AfterRegistration | ( | void | ) | [virtual] |
Reimplemented from elastix::BaseComponent.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::AutomaticParameterEstimation | ( | void | ) | [protected, virtual] |
Estimates some reasonable values for the parameters SP_a, SP_alpha (=1), SigmoidMin, SigmoidMax (=1), and SigmoidScale.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::BeforeEachResolution | ( | void | ) | [virtual] |
Reimplemented from elastix::BaseComponent.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::BeforeRegistration | ( | void | ) | [virtual] |
Methods invoked by elastix, in which parameters can be set and progress information can be printed.
Reimplemented from elastix::BaseComponent.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::CheckForAdvancedTransform | ( | void | ) | [protected, virtual] |
Check if the transform is an advanced transform. Called by Initialize.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::ComputeJacobianTerms | ( | double & | TrC, |
double & | TrCC, | ||
double & | maxJJ, | ||
double & | maxJCJ | ||
) | [protected, virtual] |
Functions to compute the Jacobian terms needed for the automatic parameter estimation.
elastix::AdaptiveStochasticGradientDescent< TElastix >::elxClassNameMacro | ( | "AdaptiveStochasticGradientDescent< TElastix >" | ) |
Name of this class. Use this name in the parameter file to select this specific optimizer. example: (Optimizer "AdaptiveStochasticGradientDescent")
virtual bool elastix::AdaptiveStochasticGradientDescent< TElastix >::GetAutomaticParameterEstimation | ( | ) | const [virtual] |
virtual const char* elastix::AdaptiveStochasticGradientDescent< TElastix >::GetClassName | ( | ) | const [virtual] |
Run-time type information (and related methods).
Reimplemented from itk::AdaptiveStochasticGradientDescentOptimizer.
virtual const unsigned long& elastix::AdaptiveStochasticGradientDescent< TElastix >::GetMaximumNumberOfSamplingAttempts | ( | ) | [virtual] |
Get the MaximumNumberOfSamplingAttempts.
virtual double elastix::AdaptiveStochasticGradientDescent< TElastix >::GetMaximumStepLength | ( | ) | const [virtual] |
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::GetScaledDerivativeWithExceptionHandling | ( | const ParametersType & | parameters, |
DerivativeType & | derivative | ||
) | [protected, virtual] |
Helper function, which calls GetScaledValueAndDerivative and does some exception handling. Used by SampleGradients.
elastix::AdaptiveStochasticGradientDescent< TElastix >::itkStaticConstMacro | ( | FixedImageDimension | , |
unsigned | int, | ||
FixedImageType::ImageDimension | |||
) | [protected] |
elastix::AdaptiveStochasticGradientDescent< TElastix >::itkStaticConstMacro | ( | MovingImageDimension | , |
unsigned | int, | ||
MovingImageType::ImageDimension | |||
) | [protected] |
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::MetricErrorResponse | ( | ExceptionObject & | err | ) | [virtual] |
Stop optimization and pass on exception.
Reimplemented from itk::GradientDescentOptimizer2.
static Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::New | ( | ) | [static] |
Method for creation through the object factory.
Reimplemented from itk::AdaptiveStochasticGradientDescentOptimizer.
void elastix::AdaptiveStochasticGradientDescent< TElastix >::operator= | ( | const Self & | ) | [private] |
Reimplemented from itk::AdaptiveStochasticGradientDescentOptimizer.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::PrintSettingsVector | ( | const SettingsVectorType & | settings | ) | const [protected, virtual] |
Print the contents of the settings vector to elxout.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::ResumeOptimization | ( | void | ) | [virtual] |
If automatic gain estimation is desired, then estimate SP_a, SP_alpha SigmoidScale, SigmoidMax, SigmoidMin. After that call Superclass' implementation.
Reimplemented from itk::GradientDescentOptimizer2.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::SampleFixedImageForJacobianTerms | ( | ImageSampleContainerPointer & | sampleContainer | ) | [protected, virtual] |
Returns a container of fixed image samples, sampled using a grid sampler The grid size is determined from the user entered number of Jacobian measurements, or a default value of 200 is used. The actual number of samples depends on the presence of masks, and the restriction that the grid spacing of the grid sampler must be integer. The samples input variable contains the sample container after execution. It does not have to be initialized/allocated before.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::SampleGradients | ( | const ParametersType & | mu0, |
double | perturbationSigma, | ||
double & | gg, | ||
double & | ee | ||
) | [protected, virtual] |
Measure some derivatives, exact and approximated. Returns the squared magnitude of the gradient and approximation error. 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^2 I ); gg = g^T g, etc.
virtual void elastix::AdaptiveStochasticGradientDescent< 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, 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.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::SetMaximumNumberOfSamplingAttempts | ( | unsigned long | _arg | ) | [virtual] |
Set the MaximumNumberOfSamplingAttempts.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::SetMaximumStepLength | ( | double | _arg | ) | [virtual] |
Set/Get maximum step length.
virtual void elastix::AdaptiveStochasticGradientDescent< TElastix >::StartOptimization | ( | void | ) | [virtual] |
Check if any scales are set, and set the UseScales flag on or off; after that call the superclass' implementation.
Reimplemented from itk::StandardGradientDescentOptimizer.
AdvancedTransformType::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::m_AdvancedTransform [protected] |
The transform stored as AdvancedTransform
Definition at line 317 of file elxAdaptiveStochasticGradientDescent.h.
bool elastix::AdaptiveStochasticGradientDescent< TElastix >::m_AutomaticParameterEstimation [private] |
Definition at line 379 of file elxAdaptiveStochasticGradientDescent.h.
bool elastix::AdaptiveStochasticGradientDescent< TElastix >::m_AutomaticParameterEstimationDone [private] |
Definition at line 386 of file elxAdaptiveStochasticGradientDescent.h.
unsigned long elastix::AdaptiveStochasticGradientDescent< TElastix >::m_CurrentNumberOfSamplingAttempts [private] |
Definition at line 384 of file elxAdaptiveStochasticGradientDescent.h.
unsigned long elastix::AdaptiveStochasticGradientDescent< TElastix >::m_MaxBandCovSize [private] |
Private variables for band size estimation of covariance matrix.
Definition at line 389 of file elxAdaptiveStochasticGradientDescent.h.
unsigned long elastix::AdaptiveStochasticGradientDescent< TElastix >::m_MaximumNumberOfSamplingAttempts [private] |
Private variables for the sampling attempts.
Definition at line 383 of file elxAdaptiveStochasticGradientDescent.h.
double elastix::AdaptiveStochasticGradientDescent< TElastix >::m_MaximumStepLength [private] |
Definition at line 380 of file elxAdaptiveStochasticGradientDescent.h.
unsigned long elastix::AdaptiveStochasticGradientDescent< TElastix >::m_NumberOfBandStructureSamples [private] |
Definition at line 390 of file elxAdaptiveStochasticGradientDescent.h.
unsigned int elastix::AdaptiveStochasticGradientDescent< TElastix >::m_NumberOfGradientMeasurements [protected] |
Some options for automatic parameter estimation.
Definition at line 312 of file elxAdaptiveStochasticGradientDescent.h.
unsigned int elastix::AdaptiveStochasticGradientDescent< TElastix >::m_NumberOfJacobianMeasurements [protected] |
Definition at line 313 of file elxAdaptiveStochasticGradientDescent.h.
unsigned int elastix::AdaptiveStochasticGradientDescent< TElastix >::m_NumberOfSamplesForExactGradient [protected] |
Definition at line 314 of file elxAdaptiveStochasticGradientDescent.h.
unsigned long elastix::AdaptiveStochasticGradientDescent< TElastix >::m_PreviousErrorAtIteration [private] |
Definition at line 385 of file elxAdaptiveStochasticGradientDescent.h.
RandomGeneratorType::Pointer elastix::AdaptiveStochasticGradientDescent< TElastix >::m_RandomGenerator [protected] |
RandomGenerator for AddRandomPerturbation.
Definition at line 320 of file elxAdaptiveStochasticGradientDescent.h.
SettingsVectorType elastix::AdaptiveStochasticGradientDescent< TElastix >::m_SettingsVector [protected] |
Variable to store the automatically determined settings for each resolution.
Definition at line 306 of file elxAdaptiveStochasticGradientDescent.h.
double elastix::AdaptiveStochasticGradientDescent< TElastix >::m_SigmoidScaleFactor [protected] |
Definition at line 322 of file elxAdaptiveStochasticGradientDescent.h.
Generated on 24-10-2011 for elastix by ![]() |
![]() |