18 #ifndef itkLBFGSBOptimizer_h
19 #define itkLBFGSBOptimizer_h
23 #include "ITKOptimizersExport.h"
101 void StartOptimization()
override;
109 virtual void SetTrace(
bool flag);
111 itkGetMacro(Trace,
bool);
112 itkBooleanMacro(Trace);
140 virtual void SetCostFunctionConvergenceFactor(
double);
142 itkGetMacro(CostFunctionConvergenceFactor,
double);
148 virtual void SetProjectedGradientTolerance(
double);
150 itkGetMacro(ProjectedGradientTolerance,
double);
153 virtual void SetMaximumNumberOfIterations(
unsigned int);
155 itkGetMacro(MaximumNumberOfIterations,
unsigned int);
158 virtual void SetMaximumNumberOfEvaluations(
unsigned int);
160 itkGetMacro(MaximumNumberOfEvaluations,
unsigned int);
163 virtual void SetMaximumNumberOfCorrections(
unsigned int);
165 itkGetMacro(MaximumNumberOfCorrections,
unsigned int);
170 itkExceptionMacro(<<
"This optimizer does not support scales.");
174 itkGetConstReferenceMacro(CurrentIteration,
unsigned int);
177 MeasureType GetValue()
const;
181 itkGetConstReferenceMacro(InfinityNormOfProjectedGradient,
double);
184 const std::string GetStopConditionDescription()
const override;
189 void PrintSelf(std::ostream & os,
Indent indent)
const override;
199 bool m_OptimizerInitialized{
false};
200 double m_CostFunctionConvergenceFactor{1
e+7};
201 double m_ProjectedGradientTolerance{1
e-5};
202 unsigned int m_MaximumNumberOfIterations{500};
203 unsigned int m_MaximumNumberOfEvaluations{500};
204 unsigned int m_MaximumNumberOfCorrections{5};
205 unsigned int m_CurrentIteration{0};
206 double m_InfinityNormOfProjectedGradient{0.0};
This class is a base for the CostFunctions returning a single value.
Light weight base class for most itk classes.
BoundSelectionType m_BoundSelection
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
BoundValueType m_UpperBound
Limited memory Broyden Fletcher Goldfarb Shannon minimization with simple bounds. ...
vnl_vector< double > InternalBoundValueType
This class is a base for the Optimization methods that optimize a single valued function.
BoundValueType m_LowerBound
Superclass::ScalesType ScalesType
static constexpr double e
The base of the natural logarithm or Euler's number
class ITK_FORWARD_EXPORT LBFGSBOptimizerHelper
Control indentation during Print() invocation.
void SetScales(const ScalesType &)
Wrapper helper around vnl_lbfgsb.
vnl_vector< long > InternalBoundSelectionType