go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
itk::QuasiNewtonLBFGSOptimizer Class Reference

#include <itkQuasiNewtonLBFGSOptimizer.h>

Detailed Description

ITK version of the lbfgs algorithm ...

This class is an ITK version of the netlib lbfgs_ function. It gives exactly the same results, if used in combination with the itk::MoreThuenteLineSearchOptimizer.

The optimizer solves the unconstrained minimization problem

\[ \min F(x), \quad x = ( x_1,x_2,\ldots,x_N ), \]

using the limited memory BFGS method. The routine is especially effective on problems involving a large number of variables. In a typical iteration of this method an approximation $H_k$ to the inverse of the Hessian is obtained by applying $M$ BFGS updates to a diagonal matrix $H_0$, using information from the previous $M$ steps. The user specifies the number $M$ (Memory), which determines the amount of storage required by the routine.

The algorithm is described in "On the limited memory BFGS method for large scale optimization", by D. Liu and J. Nocedal, Mathematical Programming B 45 (1989) 503-528.

The steplength is determined at each iteration by means of a line search routine. The itk::MoreThuenteLineSearchOptimizer works well.

Definition at line 58 of file itkQuasiNewtonLBFGSOptimizer.h.

Inheritance diagram for itk::QuasiNewtonLBFGSOptimizer:
Inheritance graph

Public Types

typedef SmartPointer< const SelfConstPointer
typedef Superclass::CostFunctionType CostFunctionType
typedef Superclass::DerivativeType DerivativeType
typedef Array< doubleDiagonalMatrixType
typedef LineSearchOptimizerType::Pointer LineSearchOptimizerPointer
typedef LineSearchOptimizer LineSearchOptimizerType
typedef Superclass::MeasureType MeasureType
typedef Superclass::ParametersType ParametersType
typedef SmartPointer< SelfPointer
typedef Array< doubleRhoType
typedef Superclass::ScaledCostFunctionType ScaledCostFunctionType
typedef Superclass::ScalesType ScalesType
typedef QuasiNewtonLBFGSOptimizer Self
enum  StopConditionType {
  MetricError, LineSearchError, MaximumNumberOfIterations, InvalidDiagonalMatrix,
  GradientMagnitudeTolerance, ZeroStep, Unknown
typedef std::vector< ParametersTypeSType
typedef ScaledSingleValuedNonLinearOptimizer Superclass
typedef std::vector< DerivativeTypeYType
- Public Types inherited from itk::ScaledSingleValuedNonLinearOptimizer
typedef SmartPointer< const SelfConstPointer
typedef Superclass::CostFunctionType CostFunctionType
typedef Superclass::DerivativeType DerivativeType
typedef Superclass::MeasureType MeasureType
typedef Superclass::ParametersType ParametersType
typedef SmartPointer< SelfPointer
typedef ScaledCostFunctionType::Pointer ScaledCostFunctionPointer
typedef ScaledSingleValuedCostFunction ScaledCostFunctionType
typedef NonLinearOptimizer::ScalesType ScalesType
typedef ScaledSingleValuedNonLinearOptimizer Self
typedef SingleValuedNonLinearOptimizer Superclass

Public Member Functions

virtual const char * GetClassName () const
virtual const DerivativeTypeGetCurrentGradient ()
virtual unsigned long GetCurrentIteration () const
virtual double GetCurrentStepLength () const
virtual MeasureType GetCurrentValue () const
virtual double GetGradientMagnitudeTolerance () const
virtual bool GetInLineSearch () const
virtual LineSearchOptimizerTypeGetLineSearchOptimizer ()
virtual unsigned long GetMaximumNumberOfIterations () const
virtual unsigned int GetMemory () const
virtual const StopConditionTypeGetStopCondition ()
virtual void ResumeOptimization (void)
virtual void SetGradientMagnitudeTolerance (double _arg)
virtual void SetLineSearchOptimizer (LineSearchOptimizerType *_arg)
virtual void SetMaximumNumberOfIterations (unsigned long _arg)
virtual void SetMemory (unsigned int _arg)
virtual void StartOptimization (void)
virtual void StopOptimization (void)
- Public Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
virtual const ParametersTypeGetCurrentPosition (void) const
virtual bool GetMaximize () const
virtual const ScaledCostFunctionTypeGetScaledCostFunction ()
virtual const ParametersTypeGetScaledCurrentPosition ()
bool GetUseScales (void) const
virtual void InitializeScales (void)
virtual void MaximizeOff ()
virtual void MaximizeOn ()
virtual void SetCostFunction (CostFunctionType *costFunction)
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

virtual void ComputeDiagonalMatrix (DiagonalMatrixType &diag_H0)
virtual void ComputeSearchDirection (const DerivativeType &gradient, ParametersType &searchDir)
virtual void LineSearch (const ParametersType searchDir, double &step, ParametersType &x, MeasureType &f, DerivativeType &g)
void PrintSelf (std::ostream &os, Indent indent) const
 QuasiNewtonLBFGSOptimizer ()
virtual void SetInLineSearch (bool _arg)
virtual void StoreCurrentPoint (const ParametersType &step, const DerivativeType &grad_dif)
virtual bool TestConvergence (bool firstLineSearchDone)
virtual ~QuasiNewtonLBFGSOptimizer ()
- Protected Member Functions inherited from itk::ScaledSingleValuedNonLinearOptimizer
virtual void GetScaledDerivative (const ParametersType &parameters, DerivativeType &derivative) const
virtual MeasureType GetScaledValue (const ParametersType &parameters) const
virtual void GetScaledValueAndDerivative (const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
void PrintSelf (std::ostream &os, Indent indent) const
 ScaledSingleValuedNonLinearOptimizer ()
virtual void SetCurrentPosition (const ParametersType &param)
virtual void SetScaledCurrentPosition (const ParametersType &parameters)
virtual ~ScaledSingleValuedNonLinearOptimizer ()

Protected Attributes

unsigned int m_Bound
DerivativeType m_CurrentGradient
unsigned long m_CurrentIteration
double m_CurrentStepLength
MeasureType m_CurrentValue
bool m_InLineSearch
unsigned int m_Point
unsigned int m_PreviousPoint
RhoType m_Rho
SType m_S
bool m_Stop
StopConditionType m_StopCondition
YType m_Y
- Protected Attributes inherited from itk::ScaledSingleValuedNonLinearOptimizer
ScaledCostFunctionPointer m_ScaledCostFunction
ParametersType m_ScaledCurrentPosition

Private Member Functions

void operator= (const Self &)
 QuasiNewtonLBFGSOptimizer (const Self &)

Private Attributes

double m_GradientMagnitudeTolerance
LineSearchOptimizerPointer m_LineSearchOptimizer
unsigned long m_MaximumNumberOfIterations
unsigned int m_Memory

Member Typedef Documentation

typedef SmartPointer< const Self > itk::QuasiNewtonLBFGSOptimizer::ConstPointer

Definition at line 65 of file itkQuasiNewtonLBFGSOptimizer.h.

typedef Superclass::CostFunctionType itk::QuasiNewtonLBFGSOptimizer::CostFunctionType

Definition at line 72 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 71 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 80 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 83 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 81 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 74 of file itkQuasiNewtonLBFGSOptimizer.h.

typedef Superclass::ParametersType itk::QuasiNewtonLBFGSOptimizer::ParametersType

Definition at line 68 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 64 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 77 of file itkQuasiNewtonLBFGSOptimizer.h.

typedef Superclass::ScaledCostFunctionType itk::QuasiNewtonLBFGSOptimizer::ScaledCostFunctionType

Definition at line 73 of file itkQuasiNewtonLBFGSOptimizer.h.

typedef Superclass::ScalesType itk::QuasiNewtonLBFGSOptimizer::ScalesType

Definition at line 75 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 62 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 78 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 63 of file itkQuasiNewtonLBFGSOptimizer.h.

Definition at line 79 of file itkQuasiNewtonLBFGSOptimizer.h.

Member Enumeration Documentation


Definition at line 85 of file itkQuasiNewtonLBFGSOptimizer.h.

Constructor & Destructor Documentation

itk::QuasiNewtonLBFGSOptimizer::QuasiNewtonLBFGSOptimizer ( )
virtual itk::QuasiNewtonLBFGSOptimizer::~QuasiNewtonLBFGSOptimizer ( )

Definition at line 135 of file itkQuasiNewtonLBFGSOptimizer.h.

itk::QuasiNewtonLBFGSOptimizer::QuasiNewtonLBFGSOptimizer ( const Self )

Member Function Documentation

virtual void itk::QuasiNewtonLBFGSOptimizer::ComputeDiagonalMatrix ( DiagonalMatrixType diag_H0)

Compute H0

Override this method if not satisfied with the default choice.

virtual void itk::QuasiNewtonLBFGSOptimizer::ComputeSearchDirection ( const DerivativeType gradient,
ParametersType searchDir 

Compute -Hg

COMPUTE -H*G USING THE FORMULA GIVEN IN: Nocedal, J. 1980, "Updating quasi-Newton matrices with limited storage", Mathematics of Computation, Vol.24, No.151, pp. 773-782.

virtual const char* itk::QuasiNewtonLBFGSOptimizer::GetClassName ( ) const
virtual const DerivativeType& itk::QuasiNewtonLBFGSOptimizer::GetCurrentGradient ( )
virtual unsigned long itk::QuasiNewtonLBFGSOptimizer::GetCurrentIteration ( ) const

Get information about optimization process:

virtual double itk::QuasiNewtonLBFGSOptimizer::GetCurrentStepLength ( ) const
virtual MeasureType itk::QuasiNewtonLBFGSOptimizer::GetCurrentValue ( ) const
virtual double itk::QuasiNewtonLBFGSOptimizer::GetGradientMagnitudeTolerance ( ) const

Setting: the mininum gradient magnitude.

The optimizer stops when: ||CurrentGradient|| < GradientMagnitudeTolerance * max(1, ||CurrentPosition||)

virtual bool itk::QuasiNewtonLBFGSOptimizer::GetInLineSearch ( ) const
virtual LineSearchOptimizerType* itk::QuasiNewtonLBFGSOptimizer::GetLineSearchOptimizer ( )
virtual unsigned long itk::QuasiNewtonLBFGSOptimizer::GetMaximumNumberOfIterations ( ) const

Setting: the maximum number of iterations

virtual unsigned int itk::QuasiNewtonLBFGSOptimizer::GetMemory ( ) const
virtual const StopConditionType& itk::QuasiNewtonLBFGSOptimizer::GetStopCondition ( )
virtual void itk::QuasiNewtonLBFGSOptimizer::LineSearch ( const ParametersType  searchDir,
double step,
ParametersType x,
MeasureType f,
DerivativeType g 

Perform a line search along the search direction. On calling, x, f, and g should contain the current position, the cost function value at this position, and the derivative. On return the step, x (new position), f (value at x), and g (derivative at x) are updated.

Reimplemented in elastix::QuasiNewtonLBFGS< TElastix >.

static Pointer itk::QuasiNewtonLBFGSOptimizer::New ( )
void itk::QuasiNewtonLBFGSOptimizer::operator= ( const Self )
void itk::QuasiNewtonLBFGSOptimizer::PrintSelf ( std::ostream &  os,
Indent  indent 
) const

Definition at line 138 of file itkQuasiNewtonLBFGSOptimizer.h.

virtual void itk::QuasiNewtonLBFGSOptimizer::ResumeOptimization ( void  )
virtual void itk::QuasiNewtonLBFGSOptimizer::SetGradientMagnitudeTolerance ( double  _arg)
virtual void itk::QuasiNewtonLBFGSOptimizer::SetInLineSearch ( bool  _arg)
virtual void itk::QuasiNewtonLBFGSOptimizer::SetLineSearchOptimizer ( LineSearchOptimizerType _arg)

Setting: the line search optimizer

virtual void itk::QuasiNewtonLBFGSOptimizer::SetMaximumNumberOfIterations ( unsigned long  _arg)
virtual void itk::QuasiNewtonLBFGSOptimizer::SetMemory ( unsigned int  _arg)

Setting: the memory. The number of iterations that are used to estimate the Hessian. 5 by default. 0 results in (normalised) gradient descent search directions

virtual void itk::QuasiNewtonLBFGSOptimizer::StartOptimization ( void  )
virtual void itk::QuasiNewtonLBFGSOptimizer::StopOptimization ( void  )
virtual void itk::QuasiNewtonLBFGSOptimizer::StoreCurrentPoint ( const ParametersType step,
const DerivativeType grad_dif 

Store s = x_k - x_k-1 and y = g_k - g_k-1 in m_S and m_Y, and store 1/(ys) in m_Rho.

virtual bool itk::QuasiNewtonLBFGSOptimizer::TestConvergence ( bool  firstLineSearchDone)

Check if convergence has occured; The firstLineSearchDone bool allows the implementation of TestConvergence to decide to skip a few convergence checks when no line search has performed yet (so, before the actual optimisation begins)

Reimplemented in elastix::QuasiNewtonLBFGS< TElastix >.

Field Documentation

unsigned int itk::QuasiNewtonLBFGSOptimizer::m_Bound

Definition at line 156 of file itkQuasiNewtonLBFGSOptimizer.h.

DerivativeType itk::QuasiNewtonLBFGSOptimizer::m_CurrentGradient

Definition at line 140 of file itkQuasiNewtonLBFGSOptimizer.h.

unsigned long itk::QuasiNewtonLBFGSOptimizer::m_CurrentIteration

Definition at line 142 of file itkQuasiNewtonLBFGSOptimizer.h.

double itk::QuasiNewtonLBFGSOptimizer::m_CurrentStepLength

Definition at line 145 of file itkQuasiNewtonLBFGSOptimizer.h.

MeasureType itk::QuasiNewtonLBFGSOptimizer::m_CurrentValue

Definition at line 141 of file itkQuasiNewtonLBFGSOptimizer.h.

double itk::QuasiNewtonLBFGSOptimizer::m_GradientMagnitudeTolerance

Definition at line 205 of file itkQuasiNewtonLBFGSOptimizer.h.

bool itk::QuasiNewtonLBFGSOptimizer::m_InLineSearch

Is true when the LineSearchOptimizer has been started.

Definition at line 148 of file itkQuasiNewtonLBFGSOptimizer.h.

LineSearchOptimizerPointer itk::QuasiNewtonLBFGSOptimizer::m_LineSearchOptimizer

Definition at line 206 of file itkQuasiNewtonLBFGSOptimizer.h.

unsigned long itk::QuasiNewtonLBFGSOptimizer::m_MaximumNumberOfIterations

Definition at line 204 of file itkQuasiNewtonLBFGSOptimizer.h.

unsigned int itk::QuasiNewtonLBFGSOptimizer::m_Memory

Definition at line 207 of file itkQuasiNewtonLBFGSOptimizer.h.

unsigned int itk::QuasiNewtonLBFGSOptimizer::m_Point

Definition at line 154 of file itkQuasiNewtonLBFGSOptimizer.h.

unsigned int itk::QuasiNewtonLBFGSOptimizer::m_PreviousPoint

Definition at line 155 of file itkQuasiNewtonLBFGSOptimizer.h.

RhoType itk::QuasiNewtonLBFGSOptimizer::m_Rho

Definition at line 150 of file itkQuasiNewtonLBFGSOptimizer.h.

SType itk::QuasiNewtonLBFGSOptimizer::m_S

Definition at line 151 of file itkQuasiNewtonLBFGSOptimizer.h.

bool itk::QuasiNewtonLBFGSOptimizer::m_Stop

Definition at line 144 of file itkQuasiNewtonLBFGSOptimizer.h.

StopConditionType itk::QuasiNewtonLBFGSOptimizer::m_StopCondition

Definition at line 143 of file itkQuasiNewtonLBFGSOptimizer.h.

YType itk::QuasiNewtonLBFGSOptimizer::m_Y

Definition at line 152 of file itkQuasiNewtonLBFGSOptimizer.h.

Generated on 04-09-2015 for elastix by doxygen elastix logo