40 #ifndef __itkRegularStepGradientDescentOptimizer2_h
41 #define __itkRegularStepGradientDescentOptimizer2_h
44 #include <itkSingleValuedNonLinearOptimizer.h>
53 public SingleValuedNonLinearOptimizer
58 typedef SingleValuedNonLinearOptimizer Superclass;
59 typedef SmartPointer<Self> Pointer;
60 typedef SmartPointer<const Self> ConstPointer;
67 SingleValuedNonLinearOptimizer);
75 GradientMagnitudeTolerance = 1,
77 ImageNotAvailable = 3,
78 SamplesNotAvailable = 4,
79 MaximumNumberOfIterations = 5
83 itkSetMacro(Maximize,
bool);
84 itkGetConstReferenceMacro(Maximize,
bool);
85 itkBooleanMacro(Maximize);
87 inline bool GetMinimize()
const {
return !m_Maximize; }
88 inline void SetMinimize(
bool v) { this->SetMaximize(!v); }
89 inline void MinimizeOn() { SetMaximize(
false); }
90 inline void MinimizeOff() { SetMaximize(
true); }
93 void StartOptimization();
96 void ResumeOptimization();
99 void StopOptimization();
102 itkSetMacro(MaximumStepLength,
double);
103 itkSetMacro(MinimumStepLength,
double);
104 itkGetConstReferenceMacro(MaximumStepLength,
double);
105 itkGetConstReferenceMacro(MinimumStepLength,
double);
107 itkSetMacro(RelaxationFactor,
double);
108 itkGetConstReferenceMacro(RelaxationFactor,
double);
110 itkSetMacro(NumberOfIterations,
unsigned long);
111 itkGetConstReferenceMacro(NumberOfIterations,
unsigned long);
113 itkSetMacro(GradientMagnitudeTolerance,
double);
114 itkGetConstReferenceMacro(GradientMagnitudeTolerance,
double);
116 itkSetMacro(BackTracking,
bool);
117 itkGetConstReferenceMacro(BackTracking,
bool);
119 itkSetMacro(PickUpPaceSteps,
unsigned int);
120 itkGetConstReferenceMacro(PickUpPaceSteps,
unsigned int);
122 itkGetConstReferenceMacro(CurrentStepLength,
double);
123 itkGetConstMacro(CurrentIteration,
unsigned int);
124 itkGetConstReferenceMacro(StopCondition, StopConditionType);
125 itkGetConstReferenceMacro(Value, MeasureType);
126 itkGetConstReferenceMacro(Gradient, DerivativeType);
127 itkGetConstReferenceMacro(BestParams, ParametersType);
128 itkGetConstReferenceMacro(BestValue, MeasureType);
131 RegularStepGradientDescentOptimizer2();
132 virtual ~RegularStepGradientDescentOptimizer2() {}
135 virtual void AdvanceOneStep();
140 virtual void StepAlongGradient(
double step_length_scale,
141 const DerivativeType & step_direction);
144 void PrintSelf(std::ostream& os, Indent indent)
const;
147 DerivativeType m_Gradient;
148 DerivativeType m_PreviousGradient;
153 MeasureType m_PreviousValue;
154 double m_GradientMagnitudeTolerance;
155 double m_MaximumStepLength;
156 double m_MinimumStepLength;
157 double m_CurrentStepLength;
158 double m_RelaxationFactor;
159 StopConditionType m_StopCondition;
160 unsigned long m_NumberOfIterations;
161 unsigned long m_CurrentIteration;
164 MeasureType m_BestValue;
165 ParametersType m_BestParams;
176 unsigned int m_PickUpPaceSteps;
180 RegularStepGradientDescentOptimizer2(
const Self &);
181 void operator = (
const Self &);
187 #endif // __itkRegularStepGradientDescentOptimizer2_h
Definition: itkNormalizeImageFilterWithMask.h:48
RegularStepGradientDescentOptimizer2 Self
Definition: itkRegularStepGradientDescentOptimizer2.h:57
Definition: itkRegularStepGradientDescentOptimizer2.h:52