ITK
6.0.0
Insight Toolkit
|
#include <itkLBFGSBOptimizer.h>
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 minimizes 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 64 of file itkLBFGSBOptimizer.h.
Public Member Functions | |
bool | CanUseScales () const override |
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 () |
const char * | GetNameOfClass () const override |
virtual double | GetProjectedGradientTolerance () |
std::string | GetStopConditionDescription () const override |
virtual bool | GetTrace () |
MeasureType | GetValue () const |
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) |
void | StartOptimization () override |
virtual void | TraceOn () |
virtual void | SetLowerBound (const BoundValueType &value) |
virtual const BoundValueType & | GetLowerBound () const |
virtual void | SetUpperBound (const BoundValueType &value) |
virtual const BoundValueType & | GetUpperBound () const |
virtual void | SetBoundSelection (const BoundSelectionType &value) |
virtual const BoundSelectionType & | GetBoundSelection () const |
Public Member Functions inherited from itk::SingleValuedNonLinearVnlOptimizer | |
const char * | GetNameOfClass () const override |
virtual const bool & | GetMaximize () const |
virtual void | SetMaximize (bool _arg) |
virtual void | MaximizeOn () |
bool | GetMinimize () const |
void | SetMinimize (bool v) |
void | MinimizeOn () |
void | MinimizeOff () |
virtual const MeasureType & | GetCachedValue () const |
virtual const DerivativeType & | GetCachedDerivative () const |
virtual const ParametersType & | GetCachedCurrentPosition () const |
Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer | |
virtual CostFunctionType * | GetModifiableCostFunction () |
MeasureType | GetValue (const ParametersType ¶meters) const |
virtual void | SetCostFunction (CostFunctionType *costFunction) |
Public Member Functions inherited from itk::Optimizer | |
virtual const ParametersType & | GetCurrentPosition () const |
virtual const ParametersType & | GetInitialPosition () const |
virtual void | SetInitialPosition (const ParametersType ¶m) |
void | SetScales (const ScalesType &scales) |
virtual const ScalesType & | GetScales () const |
virtual const ScalesType & | GetInverseScales () const |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
LightObject::Pointer | CreateAnother () const override |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () 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) const |
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 () |
Protected Types | |
using | CostFunctionAdaptorType = Superclass::CostFunctionAdaptorType |
Protected Types inherited from itk::SingleValuedNonLinearVnlOptimizer | |
using | CostFunctionAdaptorType = SingleValuedVnlCostFunctionAdaptor |
Protected Member Functions | |
LBFGSBOptimizer () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~LBFGSBOptimizer () override | |
Protected Member Functions inherited from itk::SingleValuedNonLinearVnlOptimizer | |
CostFunctionAdaptorType * | GetCostFunctionAdaptor () |
const CostFunctionAdaptorType * | GetCostFunctionAdaptor () const |
CostFunctionAdaptorType * | GetNonConstCostFunctionAdaptor () const |
void | PrintSelf (std::ostream &os, Indent indent) const override |
void | SetCostFunctionAdaptor (CostFunctionAdaptorType *adaptor) |
SingleValuedNonLinearVnlOptimizer () | |
~SingleValuedNonLinearVnlOptimizer () 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 () | |
virtual void | SetCurrentPosition (const ParametersType ¶m) |
~Optimizer () override=default | |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
~Object () override | |
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 Attributes | |
BoundSelectionType | m_BoundSelection {} |
double | m_CostFunctionConvergenceFactor { 1e+7 } |
unsigned int | m_CurrentIteration { 0 } |
double | m_InfinityNormOfProjectedGradient { 0.0 } |
BoundValueType | m_LowerBound {} |
unsigned int | m_MaximumNumberOfCorrections { 5 } |
unsigned int | m_MaximumNumberOfEvaluations { 500 } |
unsigned int | m_MaximumNumberOfIterations { 500 } |
bool | m_OptimizerInitialized { false } |
double | m_ProjectedGradientTolerance { 1e-5 } |
bool | m_Trace { false } |
BoundValueType | m_UpperBound {} |
std::unique_ptr< InternalOptimizerType > | m_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 { false } |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount {} |
using itk::LBFGSBOptimizer::BoundSelectionType = Array<long> |
BoundSelection type Use for defining the boundary condition for each variables.
Definition at line 89 of file itkLBFGSBOptimizer.h.
using itk::LBFGSBOptimizer::BoundValueType = Array<double> |
BoundValue type. Use for defining the lower and upper bounds on the variables.
Definition at line 84 of file itkLBFGSBOptimizer.h.
using itk::LBFGSBOptimizer::ConstPointer = SmartPointer<const Self> |
Definition at line 73 of file itkLBFGSBOptimizer.h.
|
protected |
Definition at line 213 of file itkLBFGSBOptimizer.h.
using itk::LBFGSBOptimizer::InternalBoundSelectionType = vnl_vector<long> |
Internal boundary selection storage type
Definition at line 95 of file itkLBFGSBOptimizer.h.
using itk::LBFGSBOptimizer::InternalBoundValueType = vnl_vector<double> |
Internal boundary value storage type
Definition at line 92 of file itkLBFGSBOptimizer.h.
The vnl optimizer
Definition at line 98 of file itkLBFGSBOptimizer.h.
Definition at line 72 of file itkLBFGSBOptimizer.h.
Standard "Self" type alias.
Definition at line 70 of file itkLBFGSBOptimizer.h.
Definition at line 71 of file itkLBFGSBOptimizer.h.
|
protected |
|
overrideprotected |
|
inlineoverridevirtual |
Returns false unconditionally because LBFGSBOptimizer does not support using scales.
Reimplemented from itk::SingleValuedNonLinearVnlOptimizer.
Definition at line 202 of file itkLBFGSBOptimizer.h.
|
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 |
|
virtual |
Get the current iteration number.
|
virtual |
Get the current infinity norm of the project gradient of the cost function.
|
virtual |
Set the lower bound value for each variable.
|
virtual |
|
virtual |
|
virtual |
|
overridevirtual |
Reimplemented from itk::Object.
|
virtual |
|
overridevirtual |
Get the reason for termination
Reimplemented from itk::Optimizer.
|
virtual |
|
virtual |
Set the upper bound value for each variable.
MeasureType itk::LBFGSBOptimizer::GetValue | ( | ) | const |
Get the current cost function value.
|
static |
Method for creation through the object factory.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::Object.
|
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
|
overridevirtual |
Plug in a Cost Function into the optimizer
Implements itk::SingleValuedNonLinearVnlOptimizer.
|
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 |
Set the lower bound value for each variable.
|
virtual |
Set/Get the MaximumNumberOfCorrections. Default is 5
|
virtual |
Set/Get the MaximumNumberOfEvaluations. Default is 500
|
virtual |
Set/Get the MaximumNumberOfIterations. Default is 500
|
virtual |
Set/Get the ProjectedGradientTolerance. Algorithm terminates when the project gradient is below the tolerance. Default value is 1e-5.
|
inline |
This optimizer does not support scaling of the derivatives.
Definition at line 180 of file itkLBFGSBOptimizer.h.
|
virtual |
Set/Get the optimizer trace flag. If set to true, the optimizer prints out information every iteration.
|
virtual |
Set the upper bound value for each variable.
|
overridevirtual |
Start optimization with an initial value.
Reimplemented from itk::Optimizer.
|
virtual |
|
friend |
Definition at line 218 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 233 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 222 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 227 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 228 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 231 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 226 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 225 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 224 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 221 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 223 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 220 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 232 of file itkLBFGSBOptimizer.h.
|
private |
Definition at line 230 of file itkLBFGSBOptimizer.h.