ITK
4.9.0
Insight Segmentation and Registration Toolkit
|
#include <itkRegularStepGradientDescentOptimizerv4.h>
Regular Step Gradient descent optimizer.
This optimizer is a variant of gradient descent that attempts to prevent it from taking steps that are too large. At each iteration, this optimizer will take a step along the direction of the metric derivative. Each time the direction of the derivative abruptly changes, the optimizer assumes that a local extrema has been passed and reacts by reducing the step length by a relaxation factor that is set to 0.5 by default. The default value for the initial step length is 1, and this value can only be changed manually via SetLearningRate() since this optimizer does not use the ScaleEstimator to automatically estimate the learning rate. Also note that unlike the previous version of ReuglarStepGradientDescentOptimizer, ITKv4 does not have a "maximize/minimize" option to modify the effect of the metric derivative. The assigned metric is assumed to return a parameter derivative result that "improves" the optimization.
Definition at line 46 of file itkRegularStepGradientDescentOptimizerv4.h.
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
virtual void | EstimateLearningRate () override |
double | GetCurrentStepLength () const |
virtual const char * | GetNameOfClass () const |
virtual void | StartOptimization (bool doOnlyInitialization=false) override |
virtual void | SetMinimumStepLength (TInternalComputationValueType _arg) |
virtual const TInternalComputationValueType & | GetMinimumStepLength () const |
virtual void | SetRelaxationFactor (TInternalComputationValueType _arg) |
virtual const TInternalComputationValueType & | GetRelaxationFactor () const |
virtual void | SetGradientMagnitudeTolerance (TInternalComputationValueType _arg) |
virtual const TInternalComputationValueType & | GetGradientMagnitudeTolerance () const |
Public Member Functions inherited from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType > | |
virtual const TInternalComputationValueType & | GetConvergenceValue () const |
virtual const TInternalComputationValueType & | GetLearningRate () const |
virtual const TInternalComputationValueType & | GetMaximumStepSizeInPhysicalUnits () const |
virtual void | ResumeOptimization () override |
virtual void | SetConvergenceWindowSize (SizeValueType _arg) |
virtual void | SetLearningRate (TInternalComputationValueType _arg) |
virtual void | SetMaximumStepSizeInPhysicalUnits (TInternalComputationValueType _arg) |
virtual void | SetMinimumConvergenceValue (TInternalComputationValueType _arg) |
virtual void | StopOptimization (void) override |
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 | SetReturnBestParametersAndValue (bool _arg) |
virtual const bool & | GetReturnBestParametersAndValue () const |
virtual void | ReturnBestParametersAndValueOn () |
virtual void | ReturnBestParametersAndValueOff () |
Public Member Functions inherited from itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType > | |
virtual SizeValueType | GetCurrentIteration () const override |
virtual const DerivativeType & | GetGradient () const |
virtual SizeValueType | GetNumberOfIterations () const override |
virtual const StopConditionType & | GetStopCondition () const |
virtual const StopConditionReturnStringType | GetStopConditionDescription () const override |
virtual void | SetNumberOfIterations (const SizeValueType numberOfIterations) override |
virtual void | ModifyGradientByScales () |
virtual void | ModifyGradientByLearningRate () |
Public Member Functions inherited from itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > | |
virtual const MeasureType & | GetCurrentMetricValue () const |
virtual const ParametersType & | GetCurrentPosition () const |
virtual const ThreadIdType & | GetNumberOfThreads () const |
virtual const ScalesType & | GetScales () const |
virtual const bool & | GetScalesAreIdentity () const |
bool | GetScalesInitialized () const |
virtual const MeasureType & | GetValue () const |
virtual const ScalesType & | GetWeights () const |
virtual const bool & | GetWeightsAreIdentity () const |
virtual void | SetNumberOfThreads (ThreadIdType number) |
virtual void | SetScalesEstimator (ScalesEstimatorType *_arg) |
virtual void | SetWeights (ScalesType _arg) |
virtual void | SetMetric (MetricType *_arg) |
virtual MetricType * | GetModifiableMetric () |
virtual const MetricType * | GetMetric () const |
virtual void | SetScales (const ScalesType &scales) |
virtual void | SetDoEstimateScales (bool _arg) |
virtual const bool & | GetDoEstimateScales () const |
virtual void | DoEstimateScalesOn () |
virtual void | DoEstimateScalesOff () |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *) |
unsigned long | AddObserver (const EventObject &event, Command *) const |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
virtual void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) |
void | SetDebug (bool debugFlag) const |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
virtual void | SetReferenceCount (int) override |
virtual void | UnRegister () const noexceptoverride |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
itkCloneMacro (Self) | |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
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 flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Private Member Functions | |
void | operator= (const Self &) ITK_DELETE_FUNCTION |
RegularStepGradientDescentOptimizerv4 (const Self &) ITK_DELETE_FUNCTION | |
typedef CompensatedSummation< InternalComputationValueType > itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::CompensatedSummationType |
Compensated summation type
Definition at line 77 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef SmartPointer< const Self > itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::ConstPointer |
Definition at line 54 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef Superclass::DerivativeType itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::DerivativeType |
Derivative type
Definition at line 67 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef Superclass::IndexRangeType itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::IndexRangeType |
Definition at line 71 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef TInternalComputationValueType itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::InternalComputationValueType |
It should be possible to derive the internal computation type from the class object.
Definition at line 60 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef Superclass::MeasureType itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::MeasureType |
Metric type over which this class is templated
Definition at line 70 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef Superclass::ParametersType itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::ParametersType |
Definition at line 73 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef SmartPointer< Self > itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::Pointer |
Definition at line 53 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef Superclass::ScalesType itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::ScalesType |
Definition at line 72 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef RegularStepGradientDescentOptimizerv4 itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::Self |
Standard class typedefs.
Definition at line 51 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef Superclass::StopConditionType itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::StopConditionType |
Definition at line 74 of file itkRegularStepGradientDescentOptimizerv4.h.
typedef GradientDescentOptimizerv4Template<TInternalComputationValueType> itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::Superclass |
Definition at line 52 of file itkRegularStepGradientDescentOptimizerv4.h.
|
protected |
Default constructor
|
protectedvirtual |
Destructor
|
private |
|
overrideprotectedvirtual |
Advance one Step following the gradient direction. Includes transform update.
Reimplemented from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >.
|
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::GradientDescentOptimizerv4Template< TInternalComputationValueType >.
|
overridevirtual |
Estimate the learning rate based on the current gradient.
Reimplemented from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >.
double itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >::GetCurrentStepLength | ( | ) | const |
Get current gradient step value
|
virtual |
Set/Get gradient magnitude tolerance value
|
virtual |
Minimum step length (learning rate) value for convergence checking. The step length is decreased by relaxation factor if the step is too long, and the algorithm passes the local minimum. When the step length value reaches a small value, it would be treated as converged.
The default m_MinimumStepLength is set to 1e-4 to pass all tests.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >.
|
virtual |
Set/Get relaxation factor value
|
overrideprotectedvirtual |
Modify the input gradient over a given index range.
Reimplemented from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >.
|
overrideprotectedvirtual |
Modify the input gradient over a given index range.
Reimplemented from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >.
|
static |
New macro for creation of through a Smart Pointer
|
private |
|
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::GradientDescentOptimizerv4Template< TInternalComputationValueType >.
|
virtual |
Set/Get gradient magnitude tolerance value
|
virtual |
Minimum step length (learning rate) value for convergence checking. The step length is decreased by relaxation factor if the step is too long, and the algorithm passes the local minimum. When the step length value reaches a small value, it would be treated as converged.
The default m_MinimumStepLength is set to 1e-4 to pass all tests.
|
virtual |
Set/Get relaxation factor value
|
overridevirtual |
Start and run the optimization
Reimplemented from itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >.
|
protected |
Current scale for learning rate
Definition at line 144 of file itkRegularStepGradientDescentOptimizerv4.h.
|
protected |
Minimum gradient magnitude value for convergence checking
Definition at line 141 of file itkRegularStepGradientDescentOptimizerv4.h.
|
protected |
Minimum gradient step value for convergence checking
Definition at line 138 of file itkRegularStepGradientDescentOptimizerv4.h.
|
protected |
When the local minima is passed by taking a large step, the step size is adjusted by the relaxation factor, so we can take smaller steps toward the minimum point.
Definition at line 127 of file itkRegularStepGradientDescentOptimizerv4.h.