18#ifndef itkLBFGSBOptimizer_h
19#define itkLBFGSBOptimizer_h
23#include "ITKOptimizersExport.h"
114 itkGetMacro(Trace,
bool);
115 itkBooleanMacro(Trace);
149 itkGetMacro(CostFunctionConvergenceFactor,
double);
158 itkGetMacro(ProjectedGradientTolerance,
double);
164 itkGetMacro(MaximumNumberOfIterations,
unsigned int);
170 itkGetMacro(MaximumNumberOfEvaluations,
unsigned int);
176 itkGetMacro(MaximumNumberOfCorrections,
unsigned int);
182 itkExceptionMacro(
"This optimizer does not support scales.");
186 itkGetConstReferenceMacro(CurrentIteration,
unsigned int);
194 itkGetConstReferenceMacro(InfinityNormOfProjectedGradient,
double);
220 bool m_Trace{
false };
221 bool m_OptimizerInitialized{
false };
222 double m_CostFunctionConvergenceFactor{ 1
e+7 };
223 double m_ProjectedGradientTolerance{ 1
e-5 };
224 unsigned int m_MaximumNumberOfIterations{ 500 };
225 unsigned int m_MaximumNumberOfEvaluations{ 500 };
226 unsigned int m_MaximumNumberOfCorrections{ 5 };
227 unsigned int m_CurrentIteration{ 0 };
228 double m_InfinityNormOfProjectedGradient{ 0.0 };
Wrapper helper around vnl_lbfgsb.
Control indentation during Print() invocation.
Limited memory Broyden Fletcher Goldfarb Shannon minimization with simple bounds.
virtual void SetProjectedGradientTolerance(double)
~LBFGSBOptimizer() override
bool CanUseScales() const override
std::unique_ptr< InternalOptimizerType > m_VnlOptimizer
virtual void SetCostFunctionConvergenceFactor(double)
vnl_vector< long > InternalBoundSelectionType
void SetCostFunction(SingleValuedCostFunction *costFunction) override
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
virtual void SetMaximumNumberOfIterations(unsigned int)
virtual void SetMaximumNumberOfEvaluations(unsigned int)
virtual void SetMaximumNumberOfCorrections(unsigned int)
vnl_vector< double > InternalBoundValueType
std::string GetStopConditionDescription() const override
MeasureType GetValue() const
void StartOptimization() override
virtual void SetUpperBound(const BoundValueType &value)
virtual void SetLowerBound(const BoundValueType &value)
virtual void SetBoundSelection(const BoundSelectionType &value)
virtual void SetTrace(bool flag)
void SetScales(const ScalesType &)
void PrintSelf(std::ostream &os, Indent indent) const override
Light weight base class for most itk classes.
Superclass::ScalesType ScalesType
This class is a base for the CostFunctions returning a single value.
CostFunctionType::MeasureType MeasureType
This class is a base for the Optimization methods that optimize a single valued function.
static constexpr double e
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT LBFGSBOptimizerHelper