18 #ifndef itkSPSAOptimizer_h
19 #define itkSPSAOptimizer_h
23 #include "ITKOptimizersExport.h"
71 virtual void AdvanceOneStep();
74 void StartOptimization()
override;
78 void ResumeOptimization();
82 void StopOptimization();
85 virtual MeasureType GetValue()
const;
88 virtual MeasureType GetValue(
const ParametersType & parameters)
const;
103 virtual void GuessParameters(
105 double initialStepSize);
111 itkGetConstMacro(StopCondition, StopConditionType);
114 itkGetConstMacro(LearningRate,
double);
117 itkGetConstMacro(GradientMagnitude,
double);
120 itkGetConstReferenceMacro(Gradient, DerivativeType);
123 itkSetMacro(Sa,
double);
124 itkGetConstMacro(Sa,
double);
126 void Seta(
double a) { SetSa(a); }
127 double Geta() {
return GetSa(); }
131 itkSetMacro(Sc,
double);
132 itkGetConstMacro(Sc,
double);
134 void Setc(
double c) { SetSc(c); }
135 double Getc() {
return GetSc(); }
139 itkSetMacro(A,
double);
140 itkGetConstMacro(A,
double);
144 itkSetMacro(Alpha,
double);
145 itkGetConstMacro(Alpha,
double);
149 itkSetMacro(Gamma,
double);
150 itkGetConstMacro(Gamma,
double);
154 itkGetConstMacro(Maximize,
bool);
155 itkSetMacro(Maximize,
bool);
156 itkBooleanMacro(Maximize);
158 {
return !m_Maximize; }
160 { this->SetMaximize(!v); }
162 { this->MaximizeOff(); }
164 { this->MaximizeOn(); }
187 itkGetConstMacro(StateOfConvergence,
double);
190 itkSetMacro(StateOfConvergenceDecayRate,
double);
191 itkGetConstMacro(StateOfConvergenceDecayRate,
double);
205 itkSetMacro(Tolerance,
double);
206 itkGetConstMacro(Tolerance,
double);
210 const std::string GetStopConditionDescription()
const override;
218 void PrintSelf(std::ostream & os,
Indent indent)
const override;
248 virtual void GenerateDelta(
const unsigned int spaceDimension);
254 virtual void ComputeGradient(
256 DerivativeType & gradient);
278 #endif // end #ifndef itkSPSAOptimizer_h
Light weight base class for most itk classes.
unsigned long SizeValueType
double m_StateOfConvergence
An optimizer based on simultaneous perturbation...
This class is a base for the Optimization methods that optimize a single valued function.
StopConditionType m_StopCondition
double m_StateOfConvergenceDecayRate
SizeValueType m_CurrentIteration
SizeValueType m_NumberOfPerturbations
DerivativeType m_Gradient
double m_GradientMagnitude
Statistics::MersenneTwisterRandomVariateGenerator::Pointer m_Generator
SizeValueType m_MinimumNumberOfIterations
SizeValueType m_MaximumNumberOfIterations
Control indentation during Print() invocation.