18 #ifndef itkGradientDescentOptimizerv4_h
19 #define itkGradientDescentOptimizerv4_h
77 template <
typename TInternalComputationValueType>
102 using typename Superclass::DerivativeType;
105 using typename Superclass::MeasureType;
106 using typename Superclass::IndexRangeType;
107 using typename Superclass::ScalesType;
108 using typename Superclass::ParametersType;
114 itkSetMacro(LearningRate, TInternalComputationValueType);
115 itkGetConstReferenceMacro(LearningRate, TInternalComputationValueType);
124 itkSetMacro(MaximumStepSizeInPhysicalUnits, TInternalComputationValueType);
125 itkGetConstReferenceMacro(MaximumStepSizeInPhysicalUnits, TInternalComputationValueType);
135 itkSetMacro(DoEstimateLearningRateAtEachIteration,
bool);
136 itkGetConstReferenceMacro(DoEstimateLearningRateAtEachIteration,
bool);
137 itkBooleanMacro(DoEstimateLearningRateAtEachIteration);
147 itkSetMacro(DoEstimateLearningRateOnce,
bool);
148 itkGetConstReferenceMacro(DoEstimateLearningRateOnce,
bool);
149 itkBooleanMacro(DoEstimateLearningRateOnce);
161 itkSetMacro(MinimumConvergenceValue, TInternalComputationValueType);
176 itkGetConstReferenceMacro(ConvergenceValue, TInternalComputationValueType);
189 itkSetMacro(ReturnBestParametersAndValue,
bool);
190 itkGetConstReferenceMacro(ReturnBestParametersAndValue,
bool);
191 itkBooleanMacro(ReturnBestParametersAndValue);
196 StartOptimization(
bool doOnlyInitialization =
false)
override;
200 StopOptimization()
override;
204 ResumeOptimization()
override;
208 EstimateLearningRate();
218 ModifyGradientByScalesOverSubRange(
const IndexRangeType & subrange)
override;
222 ModifyGradientByLearningRateOverSubRange(
const IndexRangeType & subrange)
override;
231 PrintSelf(std::ostream & os,
Indent indent)
const override;
234 TInternalComputationValueType m_LearningRate{};
235 TInternalComputationValueType m_MinimumConvergenceValue{};
236 TInternalComputationValueType m_ConvergenceValue{};
239 MeasureType m_CurrentBestValue{};
240 ParametersType m_BestParameters{};
242 bool m_ReturnBestParametersAndValue{
false };
249 DerivativeType m_PreviousGradient{};
259 #ifndef ITK_MANUAL_INSTANTIATION
260 # include "itkGradientDescentOptimizerv4.hxx"