18 #ifndef itkGradientDescentOptimizer_h
19 #define itkGradientDescentOptimizer_h
23 #include "ITKOptimizersExport.h"
77 itkGetConstReferenceMacro(Maximize,
bool);
78 itkSetMacro(Maximize,
bool);
79 itkBooleanMacro(Maximize);
81 {
return !m_Maximize; }
83 { this->SetMaximize(!v); }
85 { this->MaximizeOff(); }
87 { this->MaximizeOn(); }
91 virtual void AdvanceOneStep();
94 void StartOptimization()
override;
98 void ResumeOptimization();
102 void StopOptimization();
105 itkSetMacro(LearningRate,
double);
108 itkGetConstReferenceMacro(LearningRate,
double);
114 itkGetConstReferenceMacro(NumberOfIterations,
SizeValueType);
120 itkGetConstReferenceMacro(Value,
double);
123 itkGetConstReferenceMacro(StopCondition, StopConditionType);
124 const std::string GetStopConditionDescription()
const override;
128 itkGetConstReferenceMacro(Gradient, DerivativeType);
133 void PrintSelf(std::ostream & os,
Indent indent)
const override;
138 bool m_Maximize{
false};
140 double m_LearningRate{1.0};
Light weight base class for most itk classes.
unsigned long SizeValueType
Implement a gradient descent optimizer.
This class is a base for the Optimization methods that optimize a single valued function.
std::ostringstream m_StopConditionDescription
Control indentation during Print() invocation.
DerivativeType m_Gradient