18#ifndef elxPreconditionedStochasticGradientDescent_h
19#define elxPreconditionedStochasticGradientDescent_h
29#include "itkMersenneTwisterRandomVariateGenerator.h"
177template <
typename TElastix>
205 using Superclass1::CostFunctionType;
206 using Superclass1::CostFunctionPointer;
216 using typename Superclass1::ParametersType;
266 itkSetMacro(AutomaticParameterEstimation,
bool);
267 itkGetConstMacro(AutomaticParameterEstimation,
bool);
270 itkSetMacro(MaximumStepLength,
double);
271 itkGetConstReferenceMacro(MaximumStepLength,
double);
274 itkSetClampMacro(RegularizationKappa,
double, 0.0, 1.0);
275 itkGetConstReferenceMacro(RegularizationKappa,
double);
411#ifndef ITK_MANUAL_INSTANTIATION
412# include "elxPreconditionedStochasticGradientDescent.hxx"
typename ElastixType::RegistrationBaseType RegistrationType
itk::Optimizer ITKBaseType
typename std::vector< SettingsType > SettingsVectorType
typename ITKBaseType::ParametersType ParametersType
typename Superclass2::ITKBaseType ITKBaseType
typename TransformType::ScalarType CoordinateRepresentationType
SizeValueType m_NumberOfBandStructureSamples
SizeValueType m_MaxBandCovSize
itk::ImageRandomSamplerBase< FixedImageType > ImageRandomSamplerBaseType
void ResumeOptimization() override
typename ImageRandomCoordinateSamplerType::Pointer ImageRandomCoordinateSamplerPointer
itk::ImageSamplerBase< FixedImageType > ImageSamplerBaseType
void StartOptimization() override
typename FixedImageType::PointType FixedImagePointType
virtual void GetScaledDerivativeWithExceptionHandling(const ParametersType ¶meters, DerivativeType &derivative)
PreconditionedStochasticGradientDescent()
itk::SizeValueType SizeValueType
void BeforeRegistration() override
typename RegistrationType::MovingImageType MovingImageType
SizeValueType m_NumberOfJacobianMeasurements
itk::ImageRandomSampler< FixedImageType > ImageRandomSamplerType
typename ImageSamplerBaseType::Pointer ImageSamplerBasePointer
typename JacobianType::ValueType JacobianValueType
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
PreconditionedStochasticGradientDescent Self
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
itk::ComputeDisplacementDistribution< FixedImageType, TransformType > ComputeDisplacementDistributionType
typename PreconditionerEstimationType::Pointer PreconditionerEstimationPointer
~PreconditionedStochasticGradientDescent() override=default
SizeValueType m_NumberOfGradientMeasurements
typename AdvancedBSplineDeformableTransformType::Pointer BSplineTransformBasePointer
itk::ComputePreconditionerUsingDisplacementDistribution< FixedImageType, TransformType > PreconditionerEstimationType
typename FixedImageType::RegionType FixedImageRegionType
typename RandomGeneratorType::Pointer RandomGeneratorPointer
virtual void SampleGradients(const ParametersType &mu0, double perturbationSigma, double &gg, double &ee)
double m_RegularizationKappa
itk::ImageGridSampler< FixedImageType > ImageGridSamplerType
typename RegistrationType::FixedImageType FixedImageType
typename itkRegistrationType::TransformType TransformType
typename AdvancedTransformType::Pointer AdvancedTransformPointer
SizeValueType m_NumberOfSpatialSamples
SizeValueType m_PreviousErrorAtIteration
bool m_AutomaticParameterEstimation
typename ElastixType::FixedImageType OutputImageType
SettingsVectorType m_SettingsVector
typename FixedImageType::IndexType FixedImageIndexType
bool m_UseNoiseCompensation
itkOverrideGetNameOfClassMacro(PreconditionedStochasticGradientDescent)
SizeValueType m_MaximumNumberOfSamplingAttempts
OptimizerBase< TElastix > Superclass2
typename ImageRandomSamplerBaseType::Pointer ImageRandomSamplerBasePointer
virtual void AutomaticPreconditionerEstimation()
bool m_OriginalButSigmoidToDefault
PreconditionedASGDOptimizer Superclass1
itk::SmartPointer< const Self > ConstPointer
itk::SmartPointer< Self > Pointer
itk::AdvancedTransform< CoordinateRepresentationType, Self::FixedImageDimension, Self::MovingImageDimension > AdvancedTransformType
typename ImageGridSamplerType::ImageSampleContainerType ImageSampleContainerType
typename ImageGridSamplerType::Pointer ImageGridSamplerPointer
ITK_DISALLOW_COPY_AND_MOVE(PreconditionedStochasticGradientDescent)
elxClassNameMacro("PreconditionedStochasticGradientDescent")
JacobianType TransformJacobianType
typename std::vector< SettingsType > SettingsVectorType
double m_SigmoidScaleFactor
double m_MaximumStepLengthRatio
void AdvanceOneStep() override
SizeValueType m_NumberOfSamplesForPrecondition
void AfterEachIteration() override
AdvancedTransformPointer m_AdvancedTransform
SizeValueType m_CurrentNumberOfSamplingAttempts
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
void AfterRegistration() override
SizeValueType m_NumberOfSamplesForNoiseCompensationFactor
itk::AdvancedBSplineDeformableTransformBase< CoordinateRepresentationType, Self::FixedImageDimension > AdvancedBSplineDeformableTransformType
typename TransformType::JacobianType JacobianType
bool m_AutomaticParameterEstimationDone
void MetricErrorResponse(itk::ExceptionObject &err) override
double m_MaximumStepLength
virtual void AddRandomPerturbation(ParametersType ¶meters, double sigma)
void BeforeEachResolution() override
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
itk::ImageRandomCoordinateSampler< FixedImageType > ImageRandomCoordinateSamplerType
typename ImageRandomSamplerType::Pointer ImageRandomSamplerPointer
void AfterEachResolution() override
typename ImageSampleContainerType::Pointer ImageSampleContainerPointer
typename RegistrationType::ITKBaseType itkRegistrationType
This is a helper class for the automatic parameter estimation of the ASGD optimizer.
This is a helper class for the automatic estimation of a preconditioner for the FPSGD optimizer....
SmartPointer< Self > Pointer
Samples image voxels on a regular grid.
VectorDataContainer< ImageSampleType > ImageSampleContainerType
SmartPointer< Self > Pointer
Samples an image by randomly composing a set of physical coordinates.
SmartPointer< Self > Pointer
This class is a base class for any image sampler that randomly picks samples.
SmartPointer< Self > Pointer
Samples randomly some voxels of an image.
SmartPointer< Self > Pointer
This class is a base class for any image sampler.
SmartPointer< Self > Pointer
This class implements a gradient descent optimizer with adaptive gain.
PreconditionedASGDOptimizer()