#include <itkLBFGSBOptimizerv4.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
For algorithmic details see [18] and [147].
Definition at line 56 of file itkLBFGSBOptimizerv4.h.
Public Member Functions | |
bool | CanUseScales () const override |
virtual::itk::LightObject::Pointer | CreateAnother () const |
virtual const BoundSelectionType & | GetBoundSelection () const |
virtual double | GetCostFunctionConvergenceFactor () const |
virtual const double & | GetInfinityNormOfProjectedGradient () const |
ParametersType & | GetInitialPosition () |
virtual const BoundValueType & | GetLowerBound () const |
virtual unsigned int | GetMaximumNumberOfCorrections () const |
const char * | GetNameOfClass () const override |
virtual const BoundValueType & | GetUpperBound () const |
void | SetBoundSelection (const BoundSelectionType &value) |
virtual void | SetCostFunctionConvergenceFactor (double) |
void | SetInitialPosition (const ParametersType ¶m) |
void | SetLowerBound (const BoundValueType &value) |
virtual void | SetMaximumNumberOfCorrections (unsigned int) |
void | SetMetric (MetricType *metric) override |
void | SetScales (const ScalesType &) override |
void | SetUpperBound (const BoundValueType &value) |
void | StartOptimization (bool doOnlyInitialization=false) override |
![]() | |
virtual double | GetGradientConvergenceTolerance () const |
virtual double | GetGradientConvergenceTolerance () const |
virtual unsigned int | GetMaximumNumberOfFunctionEvaluations () const |
virtual unsigned int | GetMaximumNumberOfFunctionEvaluations () const |
const char * | GetNameOfClass () const override |
const char * | GetNameOfClass () const override |
InternalOptimizerType * | GetOptimizer () |
InternalOptimizerType * | GetOptimizer () |
StopConditionReturnStringType | GetStopConditionDescription () const override |
StopConditionReturnStringType | GetStopConditionDescription () const override |
virtual bool | GetTrace () const |
virtual bool | GetTrace () const |
virtual void | SetGradientConvergenceTolerance (double f) |
virtual void | SetGradientConvergenceTolerance (double f) |
virtual void | SetMaximumNumberOfFunctionEvaluations (unsigned int n) |
virtual void | SetMaximumNumberOfFunctionEvaluations (unsigned int n) |
void | SetMetric (MetricType *metric) override |
void | SetMetric (MetricType *metric) override |
virtual void | SetTrace (bool flag) |
virtual void | SetTrace (bool flag) |
void | StartOptimization (bool doOnlyInitialization=false) override |
void | StartOptimization (bool doOnlyInitialization=false) override |
virtual void | TraceOff () |
virtual void | TraceOff () |
virtual void | TraceOn () |
virtual void | TraceOn () |
![]() | |
const char * | GetNameOfClass () const override |
void | StartOptimization (bool doOnlyInitialization=false) override |
virtual const DerivativeType & | GetCachedDerivative () const |
virtual const ParametersType & | GetCachedCurrentPosition () const |
![]() | |
virtual SizeValueType | GetCurrentIteration () const |
virtual SizeValueType | GetCurrentIteration () const |
virtual const MeasureType & | GetCurrentMetricValue () const |
virtual const MeasureType & | GetCurrentMetricValue () const |
virtual const ParametersType & | GetCurrentPosition () const |
virtual const ParametersType & | GetCurrentPosition () const |
virtual SizeValueType | GetNumberOfIterations () const |
virtual SizeValueType | GetNumberOfIterations () const |
virtual const ThreadIdType & | GetNumberOfWorkUnits () const |
virtual const ThreadIdType & | GetNumberOfWorkUnits () const |
virtual const ScalesType & | GetScales () const |
virtual const ScalesType & | GetScales () const |
virtual const bool & | GetScalesAreIdentity () const |
virtual const bool & | GetScalesAreIdentity () const |
bool | GetScalesInitialized () const |
bool | GetScalesInitialized () const |
virtual const MeasureType & | GetValue () const |
virtual const MeasureType & | GetValue () const |
virtual const ScalesType & | GetWeights () const |
virtual const ScalesType & | GetWeights () const |
virtual const bool & | GetWeightsAreIdentity () const |
virtual const bool & | GetWeightsAreIdentity () const |
virtual void | SetNumberOfIterations (SizeValueType _arg) |
virtual void | SetNumberOfIterations (SizeValueType _arg) |
virtual void | SetNumberOfWorkUnits (ThreadIdType number) |
virtual void | SetNumberOfWorkUnits (ThreadIdType number) |
virtual void | SetScalesEstimator (ScalesEstimatorType *_arg) |
virtual void | SetScalesEstimator (ScalesEstimatorType *_arg) |
virtual void | SetWeights (ScalesType _arg) |
virtual void | SetWeights (ScalesType _arg) |
virtual MetricType * | GetModifiableMetric () |
virtual const MetricType * | GetMetric () const |
virtual MetricType * | GetModifiableMetric () |
virtual const MetricType * | GetMetric () const |
virtual void | SetDoEstimateScales (bool _arg) |
virtual const bool & | GetDoEstimateScales () const |
virtual void | DoEstimateScalesOn () |
virtual void | DoEstimateScalesOff () |
virtual void | SetDoEstimateScales (bool _arg) |
virtual const bool & | GetDoEstimateScales () const |
virtual void | DoEstimateScalesOn () |
virtual void | DoEstimateScalesOff () |
![]() | |
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 |
![]() | |
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 bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
![]() | |
static void | BreakOnError () |
static Pointer | New () |
Protected Types | |
using | CostFunctionAdaptorType = Superclass::CostFunctionAdaptorType |
using | InternalOptimizerType = LBFGSBOptimizerHelperv4 |
![]() | |
using | CostFunctionAdaptorType |
using | CostFunctionAdaptorType |
using | InternalOptimizerAutoPointer |
using | InternalOptimizerAutoPointer |
![]() | |
using | CostFunctionAdaptorType = SingleValuedVnlCostFunctionAdaptorv4 |
Private Attributes | |
BoundSelectionType | m_BoundSelection {} |
ParametersType | m_InitialPosition {} |
BoundValueType | m_LowerBound {} |
unsigned int | m_MaximumNumberOfCorrections { 5 } |
BoundValueType | m_UpperBound {} |
Friends | |
class | LBFGSBOptimizerHelperv4 |
using itk::LBFGSBOptimizerv4::BoundSelectionType = Array<long> |
BoundSelection type Use for defining the boundary condition for each variables.
Definition at line 93 of file itkLBFGSBOptimizerv4.h.
using itk::LBFGSBOptimizerv4::BoundValueType = Array<double> |
BoundValue type. Use for defining the lower and upper bounds on the variables.
Definition at line 88 of file itkLBFGSBOptimizerv4.h.
using itk::LBFGSBOptimizerv4::ConstPointer = SmartPointer<const Self> |
Definition at line 65 of file itkLBFGSBOptimizerv4.h.
|
protected |
Definition at line 175 of file itkLBFGSBOptimizerv4.h.
|
protected |
Internal optimizer type.
Definition at line 178 of file itkLBFGSBOptimizerv4.h.
Definition at line 67 of file itkLBFGSBOptimizerv4.h.
Definition at line 68 of file itkLBFGSBOptimizerv4.h.
Definition at line 64 of file itkLBFGSBOptimizerv4.h.
Definition at line 69 of file itkLBFGSBOptimizerv4.h.
Standard "Self" type alias.
Definition at line 62 of file itkLBFGSBOptimizerv4.h.
using itk::LBFGSBOptimizerv4::Superclass = LBFGSOptimizerBasev4<vnl_lbfgsb> |
Definition at line 63 of file itkLBFGSBOptimizerv4.h.
Enumerator | |
---|---|
UNBOUNDED | |
LOWERBOUNDED | |
BOTHBOUNDED | |
UPPERBOUNDED |
Definition at line 77 of file itkLBFGSBOptimizerv4.h.
|
protected |
Referenced by GetNameOfClass().
|
overrideprotected |
|
inlineoverridevirtual |
Returns false unconditionally because LBFGSBOptimizerv4 does not support using scales.
Reimplemented from itk::ObjectToObjectOptimizerBaseTemplate< double >.
Definition at line 164 of file itkLBFGSBOptimizerv4.h.
|
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::LightObject.
|
virtual |
|
virtual |
|
virtual |
Get the current infinity norm of the project gradient of the cost function.
|
inline |
Get the position to initialize the optimization.
Definition at line 101 of file itkLBFGSBOptimizerv4.h.
References m_InitialPosition.
|
virtual |
|
virtual |
|
overridevirtual |
Reimplemented from itk::LightObject.
References LBFGSBOptimizerv4().
|
virtual |
|
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::LightObject.
void itk::LBFGSBOptimizerv4::SetBoundSelection | ( | const BoundSelectionType & | value | ) |
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 |
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.
void itk::LBFGSBOptimizerv4::SetInitialPosition | ( | const ParametersType & | param | ) |
Set the position to initialize the optimization.
void itk::LBFGSBOptimizerv4::SetLowerBound | ( | const BoundValueType & | value | ) |
Set the lower bound value for each variable.
|
virtual |
Set/Get the MaximumNumberOfCorrections. Default is 5
|
overridevirtual |
Plug in a Cost Function into the optimizer
Implements itk::SingleValuedNonLinearVnlOptimizerv4.
|
overridevirtual |
This optimizer does not support scaling of the derivatives.
Reimplemented from itk::ObjectToObjectOptimizerBaseTemplate< double >.
void itk::LBFGSBOptimizerv4::SetUpperBound | ( | const BoundValueType & | value | ) |
Set the upper bound value for each variable.
|
overridevirtual |
Start optimization with an initial value.
Reimplemented from itk::ObjectToObjectOptimizerBaseTemplate< double >.
|
friend |
Definition at line 180 of file itkLBFGSBOptimizerv4.h.
References LBFGSBOptimizerHelperv4.
Referenced by LBFGSBOptimizerHelperv4.
|
private |
Definition at line 188 of file itkLBFGSBOptimizerv4.h.
|
private |
Definition at line 185 of file itkLBFGSBOptimizerv4.h.
Referenced by GetInitialPosition().
|
private |
Definition at line 186 of file itkLBFGSBOptimizerv4.h.
|
private |
Definition at line 183 of file itkLBFGSBOptimizerv4.h.
|
private |
Definition at line 187 of file itkLBFGSBOptimizerv4.h.