ITK  4.9.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
itk::LBFGSBOptimizer Class Reference

#include <itkLBFGSBOptimizer.h>

+ Inheritance diagram for itk::LBFGSBOptimizer:
+ Collaboration diagram for itk::LBFGSBOptimizer:

Detailed Description

Limited memory Broyden Fletcher Goldfarb Shannon minimization with simple bounds.

This class is a wrapper for converted fortan code for performing limited memory Broyden Fletcher Goldfarb Shannon minimization with simple bounds. The algorithm miminizes a nonlinear function f(x) of n variables subject to simple bound constraints of l <= x <= u.

See also the documentation in Numerics/lbfgsb.c

References:

[1] R. H. Byrd, P. Lu and J. Nocedal. A Limited Memory Algorithm for Bound Constrained Optimization, (1995), SIAM Journal on Scientific and Statistical Computing , 16, 5, pp. 1190-1208.

[2] C. Zhu, R. H. Byrd and J. Nocedal. L-BFGS-B: Algorithm 778: L-BFGS-B, FORTRAN routines for large scale bound constrained optimization (1997), ACM Transactions on Mathematical Software, Vol 23, Num. 4, pp. 550 - 560.

Examples:
Examples/RegistrationITKv3/DeformableRegistration12.cxx, Examples/RegistrationITKv3/DeformableRegistration7.cxx, and Examples/RegistrationITKv3/DeformableRegistration8.cxx.

Definition at line 63 of file itkLBFGSBOptimizer.h.

Public Types

typedef Array< long > BoundSelectionType
 
typedef Array< double > BoundValueType
 
typedef SmartPointer< const SelfConstPointer
 
typedef vnl_vector< long > InternalBoundSelectionType
 
typedef vnl_vector< double > InternalBoundValueType
 
typedef LBFGSBOptimizerHelper InternalOptimizerType
 
typedef SmartPointer< SelfPointer
 
typedef LBFGSBOptimizer Self
 
typedef
SingleValuedNonLinearVnlOptimizer 
Superclass
 
- Public Types inherited from itk::SingleValuedNonLinearVnlOptimizer
typedef ReceptorMemberCommand
< Self
CommandType
 
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef
SingleValuedNonLinearVnlOptimizer 
Self
 
typedef
SingleValuedNonLinearOptimizer 
Superclass
 
- Public Types inherited from itk::SingleValuedNonLinearOptimizer
typedef SmartPointer< const SelfConstPointer
 
typedef CostFunctionType::Pointer CostFunctionPointer
 
typedef SingleValuedCostFunction CostFunctionType
 
typedef
CostFunctionType::DerivativeType 
DerivativeType
 
typedef
CostFunctionType::MeasureType 
MeasureType
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef
SingleValuedNonLinearOptimizer 
Self
 
typedef NonLinearOptimizer Superclass
 
- Public Types inherited from itk::NonLinearOptimizer
typedef SmartPointer< const SelfConstPointer
 
typedef Superclass::ParametersType ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef Superclass::ScalesType ScalesType
 
typedef NonLinearOptimizer Self
 
typedef Optimizer Superclass
 
- Public Types inherited from itk::Optimizer
typedef SmartPointer< const SelfConstPointer
 
typedef OptimizerParameters
< double > 
ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef Array< double > ScalesType
 
typedef Optimizer Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual double GetCostFunctionConvergenceFactor ()
 
virtual const unsigned int & GetCurrentIteration () const
 
virtual const double & GetInfinityNormOfProjectedGradient () const
 
virtual unsigned int GetMaximumNumberOfCorrections ()
 
virtual unsigned int GetMaximumNumberOfEvaluations ()
 
virtual unsigned int GetMaximumNumberOfIterations ()
 
virtual const char * GetNameOfClass () const
 
virtual double GetProjectedGradientTolerance ()
 
virtual const std::string GetStopConditionDescription () const override
 
virtual bool GetTrace ()
 
MeasureType GetValue () const
 
virtual void SetCostFunction (SingleValuedCostFunction *costFunction) override
 
virtual void SetCostFunctionConvergenceFactor (double)
 
virtual void SetMaximumNumberOfCorrections (unsigned int)
 
virtual void SetMaximumNumberOfEvaluations (unsigned int)
 
virtual void SetMaximumNumberOfIterations (unsigned int)
 
virtual void SetProjectedGradientTolerance (double)
 
void SetScales (const ScalesType &)
 
virtual void SetTrace (bool flag)
 
virtual void StartOptimization (void) override
 
virtual void TraceOff ()
 
virtual void TraceOn ()
 
virtual void SetLowerBound (const BoundValueType &value)
 
virtual const BoundValueTypeGetLowerBound () const
 
virtual void SetUpperBound (const BoundValueType &value)
 
virtual const BoundValueTypeGetUpperBound () const
 
virtual void SetBoundSelection (const BoundSelectionType &select)
 
virtual const BoundSelectionTypeGetBoundSelection () const
 
- Public Member Functions inherited from itk::SingleValuedNonLinearVnlOptimizer
virtual const bool & GetMaximize () const
 
virtual void SetMaximize (bool _arg)
 
virtual void MaximizeOn ()
 
virtual void MaximizeOff ()
 
bool GetMinimize () const
 
void SetMinimize (bool v)
 
void MinimizeOn ()
 
void MinimizeOff ()
 
virtual const MeasureTypeGetCachedValue () const
 
virtual const DerivativeTypeGetCachedDerivative () const
 
virtual const ParametersTypeGetCachedCurrentPosition () const
 
- Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer
virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual const CostFunctionTypeGetCostFunction () const
 
virtual CostFunctionTypeGetModifiableCostFunction ()
 
MeasureType GetValue (const ParametersType &parameters) const
 
virtual void SetCostFunction (CostFunctionType *costFunction)
 
- Public Member Functions inherited from itk::Optimizer
virtual const ParametersTypeGetCurrentPosition () const
 
virtual const ParametersTypeGetInitialPosition () const
 
virtual void SetInitialPosition (const ParametersType &param)
 
void SetScales (const ScalesType &scales)
 
virtual const ScalesTypeGetScales () const
 
virtual const ScalesTypeGetInverseScales () const
 
- 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
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () 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::SingleValuedNonLinearOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::NonLinearOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::Optimizer
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 ()
 

Protected Types

typedef
Superclass::CostFunctionAdaptorType 
CostFunctionAdaptorType
 
- Protected Types inherited from itk::SingleValuedNonLinearVnlOptimizer
typedef
SingleValuedVnlCostFunctionAdaptor 
CostFunctionAdaptorType
 

Protected Member Functions

 LBFGSBOptimizer ()
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual ~LBFGSBOptimizer ()
 
- Protected Member Functions inherited from itk::SingleValuedNonLinearVnlOptimizer
const CostFunctionAdaptorTypeGetCostFunctionAdaptor () const
 
CostFunctionAdaptorTypeGetCostFunctionAdaptor ()
 
CostFunctionAdaptorTypeGetNonConstCostFunctionAdaptor () const
 
void SetCostFunctionAdaptor (CostFunctionAdaptorType *adaptor)
 
 SingleValuedNonLinearVnlOptimizer ()
 
virtual ~SingleValuedNonLinearVnlOptimizer ()
 
- Protected Member Functions inherited from itk::SingleValuedNonLinearOptimizer
 SingleValuedNonLinearOptimizer ()
 
virtual ~SingleValuedNonLinearOptimizer ()
 
- Protected Member Functions inherited from itk::NonLinearOptimizer
 NonLinearOptimizer ()
 
virtual ~NonLinearOptimizer ()
 
- Protected Member Functions inherited from itk::Optimizer
 Optimizer ()
 
virtual void SetCurrentPosition (const ParametersType &param)
 
virtual ~Optimizer ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Member Functions

 LBFGSBOptimizer (const Self &) ITK_DELETE_FUNCTION
 
void operator= (const Self &) ITK_DELETE_FUNCTION
 

Private Attributes

BoundSelectionType m_BoundSelection
 
double m_CostFunctionConvergenceFactor
 
unsigned int m_CurrentIteration
 
double m_InfinityNormOfProjectedGradient
 
BoundValueType m_LowerBound
 
unsigned int m_MaximumNumberOfCorrections
 
unsigned int m_MaximumNumberOfEvaluations
 
unsigned int m_MaximumNumberOfIterations
 
bool m_OptimizerInitialized
 
double m_ProjectedGradientTolerance
 
bool m_Trace
 
BoundValueType m_UpperBound
 
InternalOptimizerTypem_VnlOptimizer
 

Friends

class LBFGSBOptimizerHelper
 

Additional Inherited Members

- Protected Attributes inherited from itk::SingleValuedNonLinearOptimizer
CostFunctionPointer m_CostFunction
 
- Protected Attributes inherited from itk::Optimizer
ParametersType m_CurrentPosition
 
bool m_ScalesInitialized
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Member Typedef Documentation

BoundSelection type Use for defining the boundary condition for each variables.

Definition at line 87 of file itkLBFGSBOptimizer.h.

BoundValue type. Use for defining the lower and upper bounds on the variables.

Definition at line 77 of file itkLBFGSBOptimizer.h.

Definition at line 71 of file itkLBFGSBOptimizer.h.

typedef Superclass::CostFunctionAdaptorType itk::LBFGSBOptimizer::CostFunctionAdaptorType
protected

Definition at line 189 of file itkLBFGSBOptimizer.h.

Internal boundary selection storage type

Definition at line 93 of file itkLBFGSBOptimizer.h.

typedef vnl_vector< double > itk::LBFGSBOptimizer::InternalBoundValueType

Internal boundary value storage type

Definition at line 90 of file itkLBFGSBOptimizer.h.

The vnl optimizer

Definition at line 96 of file itkLBFGSBOptimizer.h.

Definition at line 70 of file itkLBFGSBOptimizer.h.

Standard "Self" typedef.

Definition at line 68 of file itkLBFGSBOptimizer.h.

Definition at line 69 of file itkLBFGSBOptimizer.h.

Constructor & Destructor Documentation

itk::LBFGSBOptimizer::LBFGSBOptimizer ( )
protected
virtual itk::LBFGSBOptimizer::~LBFGSBOptimizer ( )
protectedvirtual
itk::LBFGSBOptimizer::LBFGSBOptimizer ( const Self )
private

Member Function Documentation

virtual::itk::LightObject::Pointer itk::LBFGSBOptimizer::CreateAnother ( ) const
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::Object.

virtual const BoundSelectionType& itk::LBFGSBOptimizer::GetBoundSelection ( ) const
virtual

Set the boundary condition for each variable, where select[i] = 0 if x[i] is unbounded, = 1 if x[i] has only a lower bound, = 2 if x[i] has both lower and upper bounds, and = 3 if x[1] has only an upper bound

virtual double itk::LBFGSBOptimizer::GetCostFunctionConvergenceFactor ( )
virtual
virtual const unsigned int& itk::LBFGSBOptimizer::GetCurrentIteration ( ) const
virtual

Get the current iteration number.

virtual const double& itk::LBFGSBOptimizer::GetInfinityNormOfProjectedGradient ( ) const
virtual

Get the current infinity norm of the project gradient of the cost function.

virtual const BoundValueType& itk::LBFGSBOptimizer::GetLowerBound ( ) const
virtual

Set the lower bound value for each variable.

virtual unsigned int itk::LBFGSBOptimizer::GetMaximumNumberOfCorrections ( )
virtual
virtual unsigned int itk::LBFGSBOptimizer::GetMaximumNumberOfEvaluations ( )
virtual
virtual unsigned int itk::LBFGSBOptimizer::GetMaximumNumberOfIterations ( )
virtual
virtual const char* itk::LBFGSBOptimizer::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

virtual double itk::LBFGSBOptimizer::GetProjectedGradientTolerance ( )
virtual
virtual const std::string itk::LBFGSBOptimizer::GetStopConditionDescription ( ) const
overridevirtual

Get the reason for termination

Reimplemented from itk::Optimizer.

virtual bool itk::LBFGSBOptimizer::GetTrace ( )
virtual
virtual const BoundValueType& itk::LBFGSBOptimizer::GetUpperBound ( ) const
virtual

Set the upper bound value for each variable.

MeasureType itk::LBFGSBOptimizer::GetValue ( ) const

Get the current cost function value.

static Pointer itk::LBFGSBOptimizer::New ( )
static

Method for creation through the object factory.

void itk::LBFGSBOptimizer::operator= ( const Self )
private
virtual void itk::LBFGSBOptimizer::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Print out internal state

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

virtual void itk::LBFGSBOptimizer::SetBoundSelection ( const BoundSelectionType select)
virtual

Set the boundary condition for each variable, where select[i] = 0 if x[i] is unbounded, = 1 if x[i] has only a lower bound, = 2 if x[i] has both lower and upper bounds, and = 3 if x[1] has only an upper bound

virtual void itk::LBFGSBOptimizer::SetCostFunction ( SingleValuedCostFunction costFunction)
overridevirtual

Plug in a Cost Function into the optimizer

Implements itk::SingleValuedNonLinearVnlOptimizer.

virtual void itk::LBFGSBOptimizer::SetCostFunctionConvergenceFactor ( double  )
virtual

Set/Get the CostFunctionConvergenceFactor. Algorithm terminates when the reduction in cost function is less than factor * epsmcj where epsmch is the machine precision. Typical values for factor: 1e+12 for low accuracy; 1e+7 for moderate accuracy and 1e+1 for extremely high accuracy.

virtual void itk::LBFGSBOptimizer::SetLowerBound ( const BoundValueType value)
virtual

Set the lower bound value for each variable.

virtual void itk::LBFGSBOptimizer::SetMaximumNumberOfCorrections ( unsigned  int)
virtual

Set/Get the MaximumNumberOfCorrections. Default is 5

virtual void itk::LBFGSBOptimizer::SetMaximumNumberOfEvaluations ( unsigned  int)
virtual

Set/Get the MaximumNumberOfEvaluations. Default is 500

virtual void itk::LBFGSBOptimizer::SetMaximumNumberOfIterations ( unsigned  int)
virtual

Set/Get the MaximumNumberOfIterations. Default is 500

virtual void itk::LBFGSBOptimizer::SetProjectedGradientTolerance ( double  )
virtual

Set/Get the ProjectedGradientTolerance. Algorithm terminates when the project gradient is below the tolerance. Default value is 1e-5.

void itk::LBFGSBOptimizer::SetScales ( const ScalesType )
inline

This optimizer does not support scaling of the derivatives.

Definition at line 166 of file itkLBFGSBOptimizer.h.

virtual void itk::LBFGSBOptimizer::SetTrace ( bool  flag)
virtual

Set/Get the optimizer trace flag. If set to true, the optimizer prints out information every iteration.

virtual void itk::LBFGSBOptimizer::SetUpperBound ( const BoundValueType value)
virtual

Set the upper bound value for each variable.

virtual void itk::LBFGSBOptimizer::StartOptimization ( void  )
overridevirtual

Start optimization with an initial value.

Reimplemented from itk::Optimizer.

virtual void itk::LBFGSBOptimizer::TraceOff ( )
virtual
virtual void itk::LBFGSBOptimizer::TraceOn ( )
virtual

Friends And Related Function Documentation

friend class LBFGSBOptimizerHelper
friend

Definition at line 197 of file itkLBFGSBOptimizer.h.

Member Data Documentation

BoundSelectionType itk::LBFGSBOptimizer::m_BoundSelection
private

Definition at line 212 of file itkLBFGSBOptimizer.h.

double itk::LBFGSBOptimizer::m_CostFunctionConvergenceFactor
private

Definition at line 201 of file itkLBFGSBOptimizer.h.

unsigned int itk::LBFGSBOptimizer::m_CurrentIteration
private

Definition at line 206 of file itkLBFGSBOptimizer.h.

double itk::LBFGSBOptimizer::m_InfinityNormOfProjectedGradient
private

Definition at line 207 of file itkLBFGSBOptimizer.h.

BoundValueType itk::LBFGSBOptimizer::m_LowerBound
private

Definition at line 210 of file itkLBFGSBOptimizer.h.

unsigned int itk::LBFGSBOptimizer::m_MaximumNumberOfCorrections
private

Definition at line 205 of file itkLBFGSBOptimizer.h.

unsigned int itk::LBFGSBOptimizer::m_MaximumNumberOfEvaluations
private

Definition at line 204 of file itkLBFGSBOptimizer.h.

unsigned int itk::LBFGSBOptimizer::m_MaximumNumberOfIterations
private

Definition at line 203 of file itkLBFGSBOptimizer.h.

bool itk::LBFGSBOptimizer::m_OptimizerInitialized
private

Definition at line 200 of file itkLBFGSBOptimizer.h.

double itk::LBFGSBOptimizer::m_ProjectedGradientTolerance
private

Definition at line 202 of file itkLBFGSBOptimizer.h.

bool itk::LBFGSBOptimizer::m_Trace
private

Definition at line 199 of file itkLBFGSBOptimizer.h.

BoundValueType itk::LBFGSBOptimizer::m_UpperBound
private

Definition at line 211 of file itkLBFGSBOptimizer.h.

InternalOptimizerType* itk::LBFGSBOptimizer::m_VnlOptimizer
private

Definition at line 209 of file itkLBFGSBOptimizer.h.


The documentation for this class was generated from the following file: