Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
#include <itkGradientDescentOptimizer2.h>
Implement a gradient descent optimizer.
GradientDescentOptimizer2 implements a simple gradient descent optimizer. At each iteration the current position is updated according to
The learning rate is a fixed scalar defined via SetLearningRate(). The optimizer steps through a user defined number of iterations; no convergence checking is done.
Additionally, user can scale each component of the but setting a scaling vector using method SetScale().
The difference of this class with the itk::GradientDescentOptimizer is that it's based on the ScaledSingleValuedNonLinearOptimizer
Definition at line 54 of file itkGradientDescentOptimizer2.h.
Public Member Functions | |
virtual void | AdvanceOneStep (void) |
virtual const char * | GetClassName () const |
virtual unsigned int | GetCurrentIteration () const |
virtual const DerivativeType & | GetGradient () |
virtual const double & | GetLearningRate () |
virtual const unsigned long & | GetNumberOfIterations () |
virtual const DerivativeType & | GetSearchDirection () |
virtual const StopConditionType & | GetStopCondition () |
virtual const double & | GetValue () |
virtual void | MetricErrorResponse (ExceptionObject &err) |
virtual void | ResumeOptimization (void) |
virtual void | SetLearningRate (double _arg) |
virtual void | SetNumberOfIterations (unsigned long _arg) |
virtual void | SetUseOpenMP (bool _arg) |
void | StartOptimization (void) override |
virtual void | StopOptimization (void) |
Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
virtual const char * | GetClassName () const |
const ParametersType & | GetCurrentPosition (void) const override |
virtual bool | GetMaximize () const |
virtual const ScaledCostFunctionType * | GetScaledCostFunction () |
virtual const ParametersType & | GetScaledCurrentPosition () |
bool | GetUseScales (void) const |
virtual void | InitializeScales (void) |
virtual void | MaximizeOff () |
virtual void | MaximizeOn () |
void | SetCostFunction (CostFunctionType *costFunction) override |
virtual void | SetMaximize (bool _arg) |
virtual void | SetUseScales (bool arg) |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
static Pointer | New () |
Protected Member Functions | |
GradientDescentOptimizer2 () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~GradientDescentOptimizer2 () override | |
Protected Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
virtual void | GetScaledDerivative (const ParametersType ¶meters, DerivativeType &derivative) const |
virtual MeasureType | GetScaledValue (const ParametersType ¶meters) const |
virtual void | GetScaledValueAndDerivative (const ParametersType ¶meters, MeasureType &value, DerivativeType &derivative) const |
void | PrintSelf (std::ostream &os, Indent indent) const override |
ScaledSingleValuedNonLinearOptimizer () | |
void | SetCurrentPosition (const ParametersType ¶m) override |
virtual void | SetScaledCurrentPosition (const ParametersType ¶meters) |
~ScaledSingleValuedNonLinearOptimizer () override | |
Protected Attributes | |
unsigned long | m_CurrentIteration |
DerivativeType | m_Gradient |
double | m_LearningRate |
unsigned long | m_NumberOfIterations |
DerivativeType | m_SearchDirection |
bool | m_Stop |
StopConditionType | m_StopCondition |
double | m_Value |
Protected Attributes inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
ScaledCostFunctionPointer | m_ScaledCostFunction |
ParametersType | m_ScaledCurrentPosition |
Private Member Functions | |
GradientDescentOptimizer2 (const Self &) | |
void | operator= (const Self &) |
Private Attributes | |
bool | m_UseOpenMP |
typedef SmartPointer< const Self > itk::GradientDescentOptimizer2::ConstPointer |
Definition at line 63 of file itkGradientDescentOptimizer2.h.
typedef Superclass::CostFunctionType itk::GradientDescentOptimizer2::CostFunctionType |
Definition at line 75 of file itkGradientDescentOptimizer2.h.
Definition at line 74 of file itkGradientDescentOptimizer2.h.
typedef Superclass::MeasureType itk::GradientDescentOptimizer2::MeasureType |
Typedefs inherited from the superclass.
Definition at line 72 of file itkGradientDescentOptimizer2.h.
Definition at line 73 of file itkGradientDescentOptimizer2.h.
typedef SmartPointer< Self > itk::GradientDescentOptimizer2::Pointer |
Definition at line 62 of file itkGradientDescentOptimizer2.h.
typedef Superclass::ScaledCostFunctionPointer itk::GradientDescentOptimizer2::ScaledCostFunctionPointer |
Definition at line 78 of file itkGradientDescentOptimizer2.h.
typedef Superclass::ScaledCostFunctionType itk::GradientDescentOptimizer2::ScaledCostFunctionType |
Definition at line 77 of file itkGradientDescentOptimizer2.h.
typedef Superclass::ScalesType itk::GradientDescentOptimizer2::ScalesType |
Definition at line 76 of file itkGradientDescentOptimizer2.h.
Standard class typedefs.
Definition at line 60 of file itkGradientDescentOptimizer2.h.
Definition at line 61 of file itkGradientDescentOptimizer2.h.
Codes of stopping conditions The MinimumStepSize stopcondition never occurs, but may be implemented in inheriting classes
Enumerator | |
---|---|
MaximumNumberOfIterations | |
MetricError | |
MinimumStepSize |
Definition at line 83 of file itkGradientDescentOptimizer2.h.
|
protected |
|
inlineoverrideprotected |
Definition at line 139 of file itkGradientDescentOptimizer2.h.
|
private |
|
virtual |
Advance one step following the gradient direction.
Reimplemented in elastix::AdaGrad< TElastix >, elastix::PreconditionedStochasticGradientDescent< TElastix >, and itk::StandardGradientDescentOptimizer.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ScaledSingleValuedNonLinearOptimizer.
Reimplemented in elastix::AdaGrad< TElastix >, itk::AdaptiveStepsizeOptimizer, elastix::AdaptiveStochasticGradientDescent< TElastix >, itk::AdaptiveStochasticGradientDescentOptimizer, elastix::PreconditionedStochasticGradientDescent< TElastix >, itk::PreconditionedASGDOptimizer, elastix::StandardGradientDescent< TElastix >, and itk::StandardGradientDescentOptimizer.
|
virtual |
Get the current iteration number.
|
virtual |
Get current gradient.
|
virtual |
Get the learning rate.
|
virtual |
Get the number of iterations.
|
virtual |
Get current search direction
|
virtual |
Get Stop condition.
|
virtual |
Get the current value.
|
virtual |
Stop optimization and pass on exception.
|
static |
Method for creation through the object factory.
|
private |
|
overrideprotected |
|
virtual |
Resume previously stopped optimization with current parameters
Reimplemented in elastix::AdaGrad< TElastix >, elastix::AdaptiveStochasticGradientDescent< TElastix >, and elastix::PreconditionedStochasticGradientDescent< TElastix >.
|
virtual |
Set the learning rate.
|
virtual |
Set the number of iterations.
|
virtual |
Set use OpenMP or not.
|
override |
Start optimization.
|
virtual |
Stop optimization.
|
protected |
Definition at line 151 of file itkGradientDescentOptimizer2.h.
|
protected |
Definition at line 144 of file itkGradientDescentOptimizer2.h.
|
protected |
Definition at line 146 of file itkGradientDescentOptimizer2.h.
|
protected |
Definition at line 150 of file itkGradientDescentOptimizer2.h.
|
protected |
Definition at line 145 of file itkGradientDescentOptimizer2.h.
|
protected |
Definition at line 149 of file itkGradientDescentOptimizer2.h.
|
protected |
Definition at line 147 of file itkGradientDescentOptimizer2.h.
|
private |
Definition at line 158 of file itkGradientDescentOptimizer2.h.
|
protected |
Definition at line 143 of file itkGradientDescentOptimizer2.h.
Generated on 1667476801 for elastix by 1.9.4 |