Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
#include <itkPreconditionedGradientDescentOptimizer.h>
Implement a gradient descent optimizer.
PreconditionedGradientDescentOptimizer 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 55 of file itkPreconditionedGradientDescentOptimizer.h.
Public Types | |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::CostFunctionType | CostFunctionType |
typedef Superclass::DerivativeType | DerivativeType |
typedef Superclass::MeasureType | MeasureType |
typedef Superclass::ParametersType | ParametersType |
typedef SmartPointer< Self > | Pointer |
typedef vnl_sparse_matrix< PreconditionValueType > | PreconditionType |
typedef DerivativeType::ValueType | PreconditionValueType |
typedef Superclass::ScaledCostFunctionPointer | ScaledCostFunctionPointer |
typedef Superclass::ScaledCostFunctionType | ScaledCostFunctionType |
typedef Superclass::ScalesType | ScalesType |
typedef PreconditionedGradientDescentOptimizer | Self |
enum | StopConditionType { MaximumNumberOfIterations , MetricError , MinimumStepSize } |
typedef ScaledSingleValuedNonLinearOptimizer | Superclass |
Public Types inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::CostFunctionType | CostFunctionType |
typedef Superclass::DerivativeType | DerivativeType |
typedef Superclass::MeasureType | MeasureType |
typedef Superclass::ParametersType | ParametersType |
typedef SmartPointer< Self > | Pointer |
typedef ScaledCostFunctionType::Pointer | ScaledCostFunctionPointer |
typedef ScaledSingleValuedCostFunction | ScaledCostFunctionType |
typedef NonLinearOptimizer::ScalesType | ScalesType |
typedef ScaledSingleValuedNonLinearOptimizer | Self |
typedef SingleValuedNonLinearOptimizer | Superclass |
Public Member Functions | |
virtual void | AdvanceOneStep (void) |
const cholmod_common * | GetCholmodCommon (void) const |
const cholmod_factor * | GetCholmodFactor (void) const |
virtual const char * | GetClassName () const |
virtual double | GetConditionNumber () const |
virtual unsigned int | GetCurrentIteration () const |
virtual double | GetDiagonalWeight () const |
virtual const DerivativeType & | GetGradient () |
virtual double | GetLargestEigenValue () const |
virtual const double & | GetLearningRate () |
virtual double | GetMinimumGradientElementMagnitude () const |
virtual const unsigned long & | GetNumberOfIterations () |
virtual const DerivativeType & | GetSearchDirection () |
virtual double | GetSparsity () const |
virtual const StopConditionType & | GetStopCondition () |
virtual const double & | GetValue () |
virtual void | MetricErrorResponse (ExceptionObject &err) |
virtual void | ResumeOptimization (void) |
virtual void | SetDiagonalWeight (double _arg) |
virtual void | SetLearningRate (double _arg) |
virtual void | SetMinimumGradientElementMagnitude (double _arg) |
virtual void | SetNumberOfIterations (unsigned long _arg) |
virtual void | SetPreconditionMatrix (PreconditionType &precondition) |
virtual void | StartOptimization (void) |
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 Types | |
typedef int | CInt |
Protected Member Functions | |
virtual void | CholmodSolve (const DerivativeType &gradient, DerivativeType &searchDirection, int solveType=CHOLMOD_A) |
PreconditionedGradientDescentOptimizer () | |
void | PrintSelf (std::ostream &os, Indent indent) const |
virtual | ~PreconditionedGradientDescentOptimizer () |
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 | |
cholmod_common * | m_CholmodCommon |
cholmod_factor * | m_CholmodFactor |
cholmod_sparse * | m_CholmodGradient |
double | m_ConditionNumber |
DerivativeType | m_Gradient |
double | m_LargestEigenValue |
double | m_LearningRate |
DerivativeType | m_SearchDirection |
double | m_Sparsity |
StopConditionType | m_StopCondition |
Protected Attributes inherited from itk::ScaledSingleValuedNonLinearOptimizer | |
ScaledCostFunctionPointer | m_ScaledCostFunction |
ParametersType | m_ScaledCurrentPosition |
Private Member Functions | |
void | operator= (const Self &) |
PreconditionedGradientDescentOptimizer (const Self &) | |
Private Attributes | |
unsigned long | m_CurrentIteration |
double | m_DiagonalWeight |
double | m_MinimumGradientElementMagnitude |
unsigned long | m_NumberOfIterations |
bool | m_Stop |
double | m_Value |
|
protected |
Cholmod index type: define at central place
Definition at line 190 of file itkPreconditionedGradientDescentOptimizer.h.
typedef SmartPointer<const Self> itk::PreconditionedGradientDescentOptimizer::ConstPointer |
Definition at line 63 of file itkPreconditionedGradientDescentOptimizer.h.
typedef Superclass::CostFunctionType itk::PreconditionedGradientDescentOptimizer::CostFunctionType |
Definition at line 75 of file itkPreconditionedGradientDescentOptimizer.h.
Definition at line 74 of file itkPreconditionedGradientDescentOptimizer.h.
typedef Superclass::MeasureType itk::PreconditionedGradientDescentOptimizer::MeasureType |
Typedefs inherited from the superclass.
Definition at line 72 of file itkPreconditionedGradientDescentOptimizer.h.
typedef Superclass::ParametersType itk::PreconditionedGradientDescentOptimizer::ParametersType |
Definition at line 73 of file itkPreconditionedGradientDescentOptimizer.h.
typedef SmartPointer<Self> itk::PreconditionedGradientDescentOptimizer::Pointer |
Definition at line 62 of file itkPreconditionedGradientDescentOptimizer.h.
typedef vnl_sparse_matrix< PreconditionValueType > itk::PreconditionedGradientDescentOptimizer::PreconditionType |
Definition at line 85 of file itkPreconditionedGradientDescentOptimizer.h.
typedef DerivativeType::ValueType itk::PreconditionedGradientDescentOptimizer::PreconditionValueType |
Some typedefs for computing the SelfHessian
Definition at line 81 of file itkPreconditionedGradientDescentOptimizer.h.
typedef Superclass::ScaledCostFunctionPointer itk::PreconditionedGradientDescentOptimizer::ScaledCostFunctionPointer |
Definition at line 78 of file itkPreconditionedGradientDescentOptimizer.h.
typedef Superclass::ScaledCostFunctionType itk::PreconditionedGradientDescentOptimizer::ScaledCostFunctionType |
Definition at line 77 of file itkPreconditionedGradientDescentOptimizer.h.
typedef Superclass::ScalesType itk::PreconditionedGradientDescentOptimizer::ScalesType |
Definition at line 76 of file itkPreconditionedGradientDescentOptimizer.h.
Standard class typedefs.
Definition at line 60 of file itkPreconditionedGradientDescentOptimizer.h.
typedef ScaledSingleValuedNonLinearOptimizer itk::PreconditionedGradientDescentOptimizer::Superclass |
Definition at line 61 of file itkPreconditionedGradientDescentOptimizer.h.
Codes of stopping conditions The MinimumStepSize stopcondition never occurs, but may be implemented in inheriting classes.
Enumerator | |
---|---|
MaximumNumberOfIterations | |
MetricError | |
MinimumStepSize |
Definition at line 91 of file itkPreconditionedGradientDescentOptimizer.h.
|
protected |
|
protectedvirtual |
|
private |
|
virtual |
Advance one step following the gradient direction.
Reimplemented in itk::StochasticPreconditionedGradientDescentOptimizer.
|
protectedvirtual |
Solve Hx = g, using the Cholesky decomposition of the preconditioner. Matlab notation: x = L'(L\g) = Pg = searchDirection The last argument can be used to also solve different systems, like L x = g.
|
inline |
Temporary functions, for debugging
Definition at line 150 of file itkPreconditionedGradientDescentOptimizer.h.
|
inline |
Definition at line 156 of file itkPreconditionedGradientDescentOptimizer.h.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ScaledSingleValuedNonLinearOptimizer.
Reimplemented in elastix::PreconditionedGradientDescent< TElastix >, itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer, and itk::StochasticPreconditionedGradientDescentOptimizer.
|
virtual |
Get estimated condition number; only valid after calling SetPreconditionMatrix
|
virtual |
Get the current iteration number.
|
virtual |
|
virtual |
Get current gradient.
|
virtual |
Get largestEigenValue; only valid after calling SetPreconditionMatrix
|
virtual |
Get the learning rate.
|
virtual |
|
virtual |
Get the number of iterations.
|
virtual |
Get current search direction
|
virtual |
Get sparsity of selfhessian; only valid after calling SetPreconditionMatrix; Takes into account that only upper half of the matrix is stored. 1 = dense, 0 = all elements zero.
|
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 |
|
protected |
|
virtual |
Resume previously stopped optimization with current parameters
Reimplemented in elastix::PreconditionedGradientDescent< TElastix >.
|
virtual |
P = P + diagonalWeight * max(eigenvalue) * Identity
|
virtual |
Set the learning rate.
|
virtual |
Threshold for elements of cost function derivative; default 1e-10
|
virtual |
Set the number of iterations.
|
virtual |
Set the preconditioning matrix, whose inverse actually will be used to precondition. On setting the precondition matrix, an eigensystem is computed immediately, the eigenvalues/vectors are modified and only the modified eigenvectors/values are stored (in the EigenSystem). NB: this function destroys the input matrix, to save memory.
|
virtual |
Start optimization.
Reimplemented in elastix::PreconditionedGradientDescent< TElastix >, and itk::StochasticPreconditionedGradientDescentOptimizer.
|
virtual |
Stop optimization.
|
protected |
Definition at line 201 of file itkPreconditionedGradientDescentOptimizer.h.
|
protected |
Definition at line 202 of file itkPreconditionedGradientDescentOptimizer.h.
|
protected |
Definition at line 203 of file itkPreconditionedGradientDescentOptimizer.h.
|
protected |
Definition at line 198 of file itkPreconditionedGradientDescentOptimizer.h.
|
private |
Definition at line 220 of file itkPreconditionedGradientDescentOptimizer.h.
|
private |
Definition at line 222 of file itkPreconditionedGradientDescentOptimizer.h.
|
protected |
Definition at line 193 of file itkPreconditionedGradientDescentOptimizer.h.
|
protected |
Definition at line 197 of file itkPreconditionedGradientDescentOptimizer.h.
|
protected |
Definition at line 194 of file itkPreconditionedGradientDescentOptimizer.h.
|
private |
Definition at line 223 of file itkPreconditionedGradientDescentOptimizer.h.
|
private |
Definition at line 219 of file itkPreconditionedGradientDescentOptimizer.h.
|
protected |
Definition at line 196 of file itkPreconditionedGradientDescentOptimizer.h.
|
protected |
Definition at line 199 of file itkPreconditionedGradientDescentOptimizer.h.
|
private |
Definition at line 216 of file itkPreconditionedGradientDescentOptimizer.h.
|
protected |
Definition at line 195 of file itkPreconditionedGradientDescentOptimizer.h.
|
private |
Definition at line 217 of file itkPreconditionedGradientDescentOptimizer.h.
Generated on 1667476801 for elastix by 1.9.4 |