18#ifndef __elxAdaptiveStochasticLBFGS_h
19#define __elxAdaptiveStochasticLBFGS_h
26#include "itkMersenneTwisterRandomVariateGenerator.h"
29#include "itkPlatformMultiThreader.h"
102template <
class TElastix>
207 itkSetMacro( MaximumStepLength,
double );
208 itkGetConstMacro( MaximumStepLength,
double );
214 itkGetConstReferenceMacro( MaximumNumberOfSamplingAttempts,
SizeValueType );
222 this->
m_Threader->SetNumberOfWorkUnits( numberOfThreads );
285 itkGetStaticConstMacro(FixedImageDimension),
292 typedef std::vector< ParametersType >
SType;
293 typedef std::vector< DerivativeType >
YType;
348 double perturbationSigma,
double & gg,
double & ee );
449#ifndef ITK_MANUAL_INSTANTIATION
450#include "elxAdaptiveStochasticLBFGS.hxx"
A gradient descent optimizer with an adaptive gain.
itk::SmartPointer< Self > Pointer
virtual void AutomaticLBFGSStepsizeEstimation(void)
Superclass1::ParametersType ParametersType
SizeValueType m_OutsideIterations
itk::SmartPointer< const Self > ConstPointer
void StartOptimization(void) override
virtual void StoreCurrentPoint(const ParametersType &step, const DerivativeType &grad_dif)
virtual void ComputeDiagonalMatrix(DiagonalMatrixType &diag_H0)
FixedImageType::IndexType FixedImageIndexType
Superclass2::ConfigurationType ConfigurationType
void SetNumberOfWorkUnits(ThreadIdType numberOfThreads)
LineSearchOptimizerType::Pointer LineSearchOptimizerPointer
itkRegistrationType::TransformType TransformType
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
virtual void PrintSettingsVector(const SettingsVectorType &settings) const
AdaptiveStochasticLBFGS()
SettingsVectorType m_SettingsVector
ImageRandomSamplerType::Pointer ImageRandomSamplerPointer
void AfterEachResolution(void) override
itk::Array< double > DiagonalMatrixType
virtual void AutomaticParameterEstimationUsingDisplacementDistribution(void)
RegistrationType::FixedImageType FixedImageType
void ThreadedAdvanceOneStep(ThreadIdType threadId, ParametersType &newPosition)
Superclass1::CostFunctionPointer CostFunctionPointer
TransformType::ScalarType CoordinateRepresentationType
ImageRandomSamplerType::ImageSampleContainerType ImageRadomSampleContainerType
void ResumeOptimization(void) override
static itk::ITK_THREAD_RETURN_TYPE AdvanceOneStepThreaderCallback(void *arg)
AdaptiveStochasticLBFGS(const Self &)
void StopOptimization(void) override
virtual void ComputeSearchDirection(const DerivativeType &gradient, DerivativeType &searchDir)
ImageRandomSamplerBaseType::Pointer ImageRandomSamplerBasePointer
bool m_AutomaticLBFGSStepsizeEstimation
void operator=(const Self &)
bool m_OriginalButSigmoidToDefault
AdaptiveStochasticLBFGSOptimizer Superclass1
itk::ImageRandomCoordinateSampler< FixedImageType > ImageRandomCoordinateSamplerType
elxClassNameMacro("AdaptiveStochasticLBFGS")
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
double m_SigmoidScaleFactor
virtual void AutomaticParameterEstimation(void)
itk::SizeValueType SizeValueType
virtual void CheckForAdvancedTransform(void)
OptimizerBase< TElastix > Superclass2
virtual void LBFGSUpdate(void)
itk::ImageRandomSampler< FixedImageType > ImageRandomSamplerType
bool m_UseAdaptiveLBFGSStepSizes
Superclass2::RegistrationType RegistrationType
unsigned int ThreadIdType
RandomGeneratorType::Pointer m_RandomGenerator
SizeValueType m_MaximumNumberOfSamplingAttempts
virtual void AddRandomPerturbation(ParametersType ¶meters, double sigma)
itk::ImageRandomSamplerBase< FixedImageType > ImageRandomSamplerBaseType
std::vector< DerivativeType > YType
SizeValueType m_PreviousErrorAtIteration
JacobianType::ValueType JacobianValueType
JacobianType TransformJacobianType
itk::MoreThuenteLineSearchOptimizer LineOptimizerType
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
bool m_UseNoiseCompensation
itk::ComputeJacobianTerms< FixedImageType, TransformType > ComputeJacobianTermsType
DerivativeType m_PreviousCurvatureGradient
virtual void GetScaledDerivativeWithExceptionHandling(const ParametersType ¶meters, DerivativeType &derivative)
std::vector< SettingsType > SettingsVectorType
SizeValueType m_NumberOfSpatialSamples
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
ImageGridSamplerType::ImageSampleContainerType ImageSampleContainerType
itk::ImageGridSampler< FixedImageType > ImageGridSamplerType
virtual void AutomaticParameterEstimationOriginal(void)
TransformType::JacobianType JacobianType
virtual void SampleGradients(const ParametersType &mu0, double perturbationSigma, double &gg, double &ee)
itk::AdvancedTransform< CoordinateRepresentationType, itkGetStaticConstMacro(FixedImageDimension), itkGetStaticConstMacro(MovingImageDimension) > AdvancedTransformType
Superclass1::CostFunctionType CostFunctionType
Superclass1::StopConditionType StopConditionType
LineOptimizerType::Pointer LineOptimizerPointer
ImageSamplerBaseType::Pointer ImageSamplerBasePointer
bool m_AutomaticParameterEstimationDone
FixedImageType::RegionType FixedImageRegionType
void BeforeRegistration(void) override
ImageRandomCoordinateSamplerType::Pointer ImageRandomCoordinateSamplerPointer
Superclass2::ElastixPointer ElastixPointer
ProgressCommand::Pointer ProgressCommandPointer
SizeValueType m_NumberOfBandStructureSamples
itk::ImageSamplerBase< FixedImageType > ImageSamplerBaseType
itk::Array< double > RhoType
Superclass2::ITKBaseType ITKBaseType
RhoType m_HessianFillValue
ImageGridSamplerType::Pointer ImageGridSamplerPointer
Superclass2::ElastixType ElastixType
ImageSampleContainerType::Pointer ImageSampleContainerPointer
void AfterEachIteration(void) override
bool m_AutomaticParameterEstimation
ImageRadomSampleContainerType::Pointer ImageRadomSampleContainerPointer
std::vector< ParametersType > SType
RegistrationType::MovingImageType MovingImageType
void AdvanceOneStep(void) override
SizeValueType m_CurrentNumberOfSamplingAttempts
AdvancedTransformType::Pointer m_AdvancedTransform
Superclass2::ConfigurationPointer ConfigurationPointer
SizeValueType m_NumberOfJacobianMeasurements
double m_MaximumStepLength
RegistrationType::ITKBaseType itkRegistrationType
SizeValueType m_NumberOfGradientMeasurements
void BeforeEachResolution(void) override
FixedImageType::PointType FixedImagePointType
SizeValueType m_MaxBandCovSize
AdaptiveStochasticLBFGS Self
ProgressCommand ProgressCommandType
void AfterRegistration(void) override
SizeValueType m_NumberOfSamplesForExactGradient
Superclass2::RegistrationPointer RegistrationPointer
void MetricErrorResponse(itk::ExceptionObject &err) override
SizeValueType m_NumberOfInnerLoopSamples
itk::ComputeDisplacementDistribution< FixedImageType, TransformType > ComputeDisplacementDistributionType
ImageSamplerBaseType::ImageSampleType ImageSampleType
itk::LineSearchOptimizer LineSearchOptimizerType
~AdaptiveStochasticLBFGS() override
A class that deals with user given parameters and command line arguments.
This class is the elastix base class for all Optimizers.
Superclass::ConfigurationPointer ConfigurationPointer
itk::Optimizer ITKBaseType
Superclass::ElastixType ElastixType
Superclass::ElastixPointer ElastixPointer
Superclass::RegistrationPointer RegistrationPointer
Superclass::RegistrationType RegistrationType
A specialized Command object for updating the progress of a filter.
itk::SmartPointer< Self > Pointer
Superclass::StopConditionType StopConditionType
Superclass::ParametersType ParametersType
Superclass::CostFunctionType CostFunctionType
This is a helper class for the automatic parameter estimation of the ASGD optimizer.
This is a helper class for the automatic parameter estimation of the ASGD optimizer.
Samples image voxels on a regular grid.
Samples an image by randomly composing a set of physical coordinates.
This class is a base class for any image sampler that randomly picks samples.
Samples randomly some voxels of an image.
A class that defines an image sample, which is the coordinates of a point and its value.
This class is a base class for any image sampler.
A base class for LineSearch optimizers.
ITK version of the MoreThuente line search algorithm.
Superclass::ParametersType ParametersType
Superclass::DerivativeType DerivativeType
ThreaderType::Pointer m_Threader
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
ParametersType * t_NewPosition