ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | List of all members

#include <itkLBFGSBOptimizer.h>

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

Public Types

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

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual const char * GetNameOfClass () const
 
virtual bool GetTrace ()
 
void SetCostFunction (SingleValuedCostFunction *costFunction) override
 
virtual void SetTrace (bool flag)
 
void StartOptimization () override
 
virtual void TraceOff ()
 
virtual void TraceOn ()
 
- 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 ParametersTypeGetInitialPosition () const
 
virtual void SetInitialPosition (const ParametersType &param)
 
void SetScales (const ScalesType &scales)
 
virtual const ScalesTypeGetScales () const
 
virtual const ScalesTypeGetInverseScales () const
 
virtual const ParametersTypeGetCurrentPosition () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) 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
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
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 val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 
using CostFunctionAdaptorType = Superclass::CostFunctionAdaptorType
 
class LBFGSBOptimizerHelper
 
bool m_Trace { false }
 
bool m_OptimizerInitialized { false }
 
double m_CostFunctionConvergenceFactor { 1e+7 }
 
double m_ProjectedGradientTolerance { 1e-5 }
 
unsigned int m_MaximumNumberOfIterations { 500 }
 
unsigned int m_MaximumNumberOfEvaluations { 500 }
 
unsigned int m_MaximumNumberOfCorrections { 5 }
 
unsigned int m_CurrentIteration { 0 }
 
double m_InfinityNormOfProjectedGradient { 0.0 }
 
InternalOptimizerTypem_VnlOptimizer { nullptr }
 
BoundValueType m_LowerBound
 
BoundValueType m_UpperBound
 
BoundSelectionType m_BoundSelection
 
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 &value)
 
virtual const BoundSelectionTypeGetBoundSelection () const
 
virtual void SetCostFunctionConvergenceFactor (double)
 
virtual double GetCostFunctionConvergenceFactor ()
 
virtual void SetProjectedGradientTolerance (double)
 
virtual double GetProjectedGradientTolerance ()
 
virtual void SetMaximumNumberOfIterations (unsigned int)
 
virtual unsigned int GetMaximumNumberOfIterations ()
 
virtual void SetMaximumNumberOfEvaluations (unsigned int)
 
virtual unsigned int GetMaximumNumberOfEvaluations ()
 
virtual void SetMaximumNumberOfCorrections (unsigned int)
 
virtual unsigned int GetMaximumNumberOfCorrections ()
 
void SetScales (const ScalesType &)
 
virtual const unsigned int & GetCurrentIteration () const
 
MeasureType GetValue () const
 
virtual const double & GetInfinityNormOfProjectedGradient () const
 
const std::string GetStopConditionDescription () const override
 
 LBFGSBOptimizer ()
 
 ~LBFGSBOptimizer () override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 

Additional Inherited Members

- Protected Types inherited from itk::SingleValuedNonLinearVnlOptimizer
using CostFunctionAdaptorType = SingleValuedVnlCostFunctionAdaptor
 
- Protected Member Functions inherited from itk::SingleValuedNonLinearVnlOptimizer
 SingleValuedNonLinearVnlOptimizer ()
 
 ~SingleValuedNonLinearVnlOptimizer () override
 
void SetCostFunctionAdaptor (CostFunctionAdaptorType *adaptor)
 
const CostFunctionAdaptorTypeGetCostFunctionAdaptor () const
 
CostFunctionAdaptorTypeGetCostFunctionAdaptor ()
 
CostFunctionAdaptorTypeGetNonConstCostFunctionAdaptor () const
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
- Protected Member Functions inherited from itk::SingleValuedNonLinearOptimizer
 SingleValuedNonLinearOptimizer ()
 
 ~SingleValuedNonLinearOptimizer () override=default
 
- Protected Member Functions inherited from itk::NonLinearOptimizer
 NonLinearOptimizer ()=default
 
 ~NonLinearOptimizer () override
 
- Protected Member Functions inherited from itk::Optimizer
 Optimizer ()
 
 ~Optimizer () override=default
 
virtual void SetCurrentPosition (const ParametersType &param)
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
 ~Object () override
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
- 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 ()
 
- Protected Attributes inherited from itk::SingleValuedNonLinearOptimizer
CostFunctionPointer m_CostFunction
 
- Protected Attributes inherited from itk::Optimizer
bool m_ScalesInitialized { false }
 
ParametersType m_CurrentPosition
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

Limited memory Broyden Fletcher Goldfarb Shannon minimization with simple bounds.

This class is a wrapper for converted Fortran code for performing limited memory Broyden Fletcher Goldfarb Shannon minimization with simple bounds. The algorithm mininizes 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.

Definition at line 63 of file itkLBFGSBOptimizer.h.

Member Typedef Documentation

◆ BoundSelectionType

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

Definition at line 88 of file itkLBFGSBOptimizer.h.

◆ BoundValueType

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

Definition at line 83 of file itkLBFGSBOptimizer.h.

◆ ConstPointer

Definition at line 72 of file itkLBFGSBOptimizer.h.

◆ CostFunctionAdaptorType

using itk::LBFGSBOptimizer::CostFunctionAdaptorType = Superclass::CostFunctionAdaptorType
protected

Set the lower bound value for each variable.

Definition at line 205 of file itkLBFGSBOptimizer.h.

◆ InternalBoundSelectionType

Internal boundary selection storage type

Definition at line 94 of file itkLBFGSBOptimizer.h.

◆ InternalBoundValueType

Internal boundary value storage type

Definition at line 91 of file itkLBFGSBOptimizer.h.

◆ InternalOptimizerType

The vnl optimizer

Definition at line 97 of file itkLBFGSBOptimizer.h.

◆ Pointer

Definition at line 71 of file itkLBFGSBOptimizer.h.

◆ Self

Standard "Self" type alias.

Definition at line 69 of file itkLBFGSBOptimizer.h.

◆ Superclass

Definition at line 70 of file itkLBFGSBOptimizer.h.

Constructor & Destructor Documentation

◆ LBFGSBOptimizer()

itk::LBFGSBOptimizer::LBFGSBOptimizer ( )
protected

Set the lower bound value for each variable.

◆ ~LBFGSBOptimizer()

itk::LBFGSBOptimizer::~LBFGSBOptimizer ( )
overrideprotected

Set the lower bound value for each variable.

Member Function Documentation

◆ CreateAnother()

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.

◆ GetBoundSelection()

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

Set the lower bound value for each variable.

◆ GetCostFunctionConvergenceFactor()

virtual double itk::LBFGSBOptimizer::GetCostFunctionConvergenceFactor ( )
virtual

Set the lower bound value for each variable.

◆ GetCurrentIteration()

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

Get the current iteration number.

◆ GetInfinityNormOfProjectedGradient()

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

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

◆ GetLowerBound()

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

Set the lower bound value for each variable.

◆ GetMaximumNumberOfCorrections()

virtual unsigned int itk::LBFGSBOptimizer::GetMaximumNumberOfCorrections ( )
virtual

Set the lower bound value for each variable.

◆ GetMaximumNumberOfEvaluations()

virtual unsigned int itk::LBFGSBOptimizer::GetMaximumNumberOfEvaluations ( )
virtual

Set the lower bound value for each variable.

◆ GetMaximumNumberOfIterations()

virtual unsigned int itk::LBFGSBOptimizer::GetMaximumNumberOfIterations ( )
virtual

Set the lower bound value for each variable.

◆ GetNameOfClass()

virtual const char* itk::LBFGSBOptimizer::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.

◆ GetProjectedGradientTolerance()

virtual double itk::LBFGSBOptimizer::GetProjectedGradientTolerance ( )
virtual

Set the lower bound value for each variable.

◆ GetStopConditionDescription()

const std::string itk::LBFGSBOptimizer::GetStopConditionDescription ( ) const
overridevirtual

Get the reason for termination

Reimplemented from itk::Optimizer.

◆ GetTrace()

virtual bool itk::LBFGSBOptimizer::GetTrace ( )
virtual

◆ GetUpperBound()

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

Set the lower bound value for each variable.

◆ GetValue()

MeasureType itk::LBFGSBOptimizer::GetValue ( ) const

Get the current cost function value.

◆ New()

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

Method for creation through the object factory.

◆ PrintSelf()

void itk::LBFGSBOptimizer::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Set the lower bound value for each variable.

Reimplemented from itk::Object.

◆ SetBoundSelection()

virtual void itk::LBFGSBOptimizer::SetBoundSelection ( const BoundSelectionType value)
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

◆ SetCostFunction()

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

Plug in a Cost Function into the optimizer

Implements itk::SingleValuedNonLinearVnlOptimizer.

◆ SetCostFunctionConvergenceFactor()

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.

◆ SetLowerBound()

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

Set the lower bound value for each variable.

◆ SetMaximumNumberOfCorrections()

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

Set/Get the MaximumNumberOfCorrections. Default is 5

◆ SetMaximumNumberOfEvaluations()

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

Set/Get the MaximumNumberOfEvaluations. Default is 500

◆ SetMaximumNumberOfIterations()

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

Set/Get the MaximumNumberOfIterations. Default is 500

◆ SetProjectedGradientTolerance()

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.

◆ SetScales()

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

This optimizer does not support scaling of the derivatives.

Definition at line 179 of file itkLBFGSBOptimizer.h.

◆ SetTrace()

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.

◆ SetUpperBound()

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

Set the upper bound value for each variable.

◆ StartOptimization()

void itk::LBFGSBOptimizer::StartOptimization ( )
overridevirtual

Start optimization with an initial value.

Reimplemented from itk::Optimizer.

◆ TraceOff()

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

◆ TraceOn()

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

Friends And Related Function Documentation

◆ LBFGSBOptimizerHelper

friend class LBFGSBOptimizerHelper
friend

Set the lower bound value for each variable.

Definition at line 210 of file itkLBFGSBOptimizer.h.

Member Data Documentation

◆ m_BoundSelection

BoundSelectionType itk::LBFGSBOptimizer::m_BoundSelection
private

Set the lower bound value for each variable.

Definition at line 225 of file itkLBFGSBOptimizer.h.

◆ m_CostFunctionConvergenceFactor

double itk::LBFGSBOptimizer::m_CostFunctionConvergenceFactor { 1e+7 }
private

Set the lower bound value for each variable.

Definition at line 214 of file itkLBFGSBOptimizer.h.

◆ m_CurrentIteration

unsigned int itk::LBFGSBOptimizer::m_CurrentIteration { 0 }
private

Set the lower bound value for each variable.

Definition at line 219 of file itkLBFGSBOptimizer.h.

◆ m_InfinityNormOfProjectedGradient

double itk::LBFGSBOptimizer::m_InfinityNormOfProjectedGradient { 0.0 }
private

Set the lower bound value for each variable.

Definition at line 220 of file itkLBFGSBOptimizer.h.

◆ m_LowerBound

BoundValueType itk::LBFGSBOptimizer::m_LowerBound
private

Set the lower bound value for each variable.

Definition at line 223 of file itkLBFGSBOptimizer.h.

◆ m_MaximumNumberOfCorrections

unsigned int itk::LBFGSBOptimizer::m_MaximumNumberOfCorrections { 5 }
private

Set the lower bound value for each variable.

Definition at line 218 of file itkLBFGSBOptimizer.h.

◆ m_MaximumNumberOfEvaluations

unsigned int itk::LBFGSBOptimizer::m_MaximumNumberOfEvaluations { 500 }
private

Set the lower bound value for each variable.

Definition at line 217 of file itkLBFGSBOptimizer.h.

◆ m_MaximumNumberOfIterations

unsigned int itk::LBFGSBOptimizer::m_MaximumNumberOfIterations { 500 }
private

Set the lower bound value for each variable.

Definition at line 216 of file itkLBFGSBOptimizer.h.

◆ m_OptimizerInitialized

bool itk::LBFGSBOptimizer::m_OptimizerInitialized { false }
private

Set the lower bound value for each variable.

Definition at line 213 of file itkLBFGSBOptimizer.h.

◆ m_ProjectedGradientTolerance

double itk::LBFGSBOptimizer::m_ProjectedGradientTolerance { 1e-5 }
private

Set the lower bound value for each variable.

Definition at line 215 of file itkLBFGSBOptimizer.h.

◆ m_Trace

bool itk::LBFGSBOptimizer::m_Trace { false }
private

Set the lower bound value for each variable.

Definition at line 212 of file itkLBFGSBOptimizer.h.

◆ m_UpperBound

BoundValueType itk::LBFGSBOptimizer::m_UpperBound
private

Set the lower bound value for each variable.

Definition at line 224 of file itkLBFGSBOptimizer.h.

◆ m_VnlOptimizer

InternalOptimizerType* itk::LBFGSBOptimizer::m_VnlOptimizer { nullptr }
private

Set the lower bound value for each variable.

Definition at line 222 of file itkLBFGSBOptimizer.h.


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