#include <itkSPSAOptimizer.h>
Inheritance diagram for itk::SPSAOptimizer:
Public Types | |
typedef SPSAOptimizer | Self |
typedef SingleValuedNonLinearOptimizer | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
enum | StopConditionType { Unknown, MaximumNumberOfIterations, BelowTolerance, MetricError } |
Public Member Functions | |
virtual const char * | GetNameOfClass () const |
virtual void | AdvanceOneStep (void) |
void | StartOptimization (void) |
void | ResumeOptimization (void) |
void | StopOptimization (void) |
virtual MeasureType | GetValue (void) const |
virtual MeasureType | GetValue (const ParametersType ¶meters) const |
virtual void | GuessParameters (unsigned long numberOfGradientEstimates, double initialStepSize) |
virtual unsigned long | GetCurrentIteration () const |
virtual StopConditionType | GetStopCondition () const |
virtual double | GetLearningRate () const |
virtual double | GetGradientMagnitude () const |
virtual const DerivativeType & | GetGradient () |
virtual double | GetStateOfConvergence () const |
virtual void | Seta (double _arg) |
virtual double | Geta () const |
virtual void | Setc (double _arg) |
virtual double | Getc () const |
virtual void | SetA (double _arg) |
virtual double | GetA () const |
virtual void | SetAlpha (double _arg) |
virtual double | GetAlpha () const |
virtual void | SetGamma (double _arg) |
virtual double | GetGamma () const |
virtual bool | GetMaximize () const |
virtual void | SetMaximize (bool _arg) |
virtual void | MaximizeOn () |
virtual void | MaximizeOff () |
bool | GetMinimize () const |
void | SetMinimize (bool v) |
void | MinimizeOn () |
void | MinimizeOff () |
virtual void | SetNumberOfPerturbations (unsigned long _arg) |
virtual unsigned long | GetNumberOfPerturbations () const |
virtual void | SetStateOfConvergenceDecayRate (double _arg) |
virtual double | GetStateOfConvergenceDecayRate () const |
virtual void | SetMinimumNumberOfIterations (unsigned long _arg) |
virtual unsigned long | GetMinimumNumberOfIterations () const |
virtual void | SetMaximumNumberOfIterations (unsigned long _arg) |
virtual unsigned long | GetMaximumNumberOfIterations () const |
virtual void | SetTolerance (double _arg) |
virtual double | GetTolerance () const |
Static Public Member Functions | |
Pointer | New () |
Protected Member Functions | |
SPSAOptimizer () | |
virtual | ~SPSAOptimizer () |
void | PrintSelf (std::ostream &os, Indent indent) const |
virtual double | Compute_a (unsigned long k) const |
virtual double | Compute_c (unsigned long k) const |
virtual void | GenerateDelta (const unsigned int spaceDimension) |
virtual void | ComputeGradient (const ParametersType ¶meters, DerivativeType &gradient) |
Protected Attributes | |
DerivativeType | m_Gradient |
double | m_LearningRate |
DerivativeType | m_Delta |
bool | m_Stop |
StopConditionType | m_StopCondition |
double | m_StateOfConvergence |
unsigned long | m_CurrentIteration |
This optimizer is an implementation of the Simultaneous Perturbation Stochastic Approximation method, described in:
Definition at line 26 of file itkSPSAOptimizer.h.
|
Reimplemented from itk::SingleValuedNonLinearOptimizer. Definition at line 35 of file itkSPSAOptimizer.h. |
|
Reimplemented from itk::SingleValuedNonLinearOptimizer. Definition at line 34 of file itkSPSAOptimizer.h. |
|
Standard class typedefs. Reimplemented from itk::SingleValuedNonLinearOptimizer. Definition at line 32 of file itkSPSAOptimizer.h. |
|
Reimplemented from itk::SingleValuedNonLinearOptimizer. Definition at line 33 of file itkSPSAOptimizer.h. |
|
Codes of stopping conditions Definition at line 44 of file itkSPSAOptimizer.h. |
|
|
|
Definition at line 187 of file itkSPSAOptimizer.h. References m_CurrentIteration, and m_StateOfConvergence. |
|
Advance one step following the gradient direction. |
|
Method to compute the learning rate at iteration k (a_k). |
|
Method to compute the gain factor for the perturbation at iteration k (c_k). |
|
Compute the gradient at a position. m_NumberOfPerturbations are used, and scales are taken into account. |
|
Method to generate a perturbation vector. Takes scales into account. |
|
Set/Get A. |
|
Set/Get a. |
|
Set/Get alpha. |
|
Set/Get c. |
|
Get the current iteration number. |
|
Set/Get gamma. |
|
Get the latest computed gradient |
|
Get the GradientMagnitude of the latest computed gradient |
|
Get the current LearningRate (a_k) |
|
Methods to configure the cost function. |
|
Set/Get the maximum number of iterations. |
|
Methods to configure the cost function. Definition at line 131 of file itkSPSAOptimizer.h. References MaximizeOff(). |
|
Set/Get the minimum number of iterations |
|
Run-time type information (and related methods). Reimplemented from itk::SingleValuedNonLinearOptimizer. |
|
Set/Get the number of perturbation used to construct a gradient estimate g_k. q = NumberOfPerturbations g_k = 1/q sum_{j=1..q} g^(j)_k |
|
Get the state of convergence in the last iteration. When the StateOfConvergence is lower than the Tolerance, and the minimum number of iterations has been performed, the optimization stops. The state of convergence (SOC) is initialized with 0.0 and updated after each iteration as follows: SOC *= SOCDecayRate SOC += a_k * GradientMagnitude |
|
Set/Get StateOfConvergenceDecayRate (number between 0 and 1). |
|
Get Stop condition. |
|
Set/Get Tolerance |
|
Get the cost function value at any position Reimplemented from itk::SingleValuedNonLinearOptimizer. |
|
Get the cost function value at the current position. |
|
Guess the parameters a and A. This function needs the number of GradientEstimates used for estimating a and A and and the expected initial step size (where step size is defined as the maximum of the absolute values of the parameter update). Make sure you set c, Alpha, Gamma, the MaximumNumberOfIterations, the Scales, and the the InitialPosition before calling this method. Described in: Spall, J.C. (1998), "Implementation of the Simultaneous Perturbation Algorithm for Stochastic Optimization", IEEE Trans. Aerosp. Electron. Syst. 34(3), 817-823. |
|
Methods to configure the cost function. Referenced by GetMinimize(). |
|
Methods to configure the cost function. Referenced by SetMinimize(). |
|
Methods to configure the cost function. Definition at line 137 of file itkSPSAOptimizer.h. |
|
Methods to configure the cost function. Definition at line 135 of file itkSPSAOptimizer.h. |
|
Method for creation through the object factory. Reimplemented from itk::SingleValuedNonLinearOptimizer. |
|
PrintSelf method. Reimplemented from itk::SingleValuedNonLinearOptimizer. |
|
Resume previously stopped optimization with current parameters
|
|
Set/Get A. |
|
Set/Get a. |
|
Set/Get alpha. |
|
Set/Get c. |
|
Set/Get gamma. |
|
Methods to configure the cost function. |
|
Set/Get the maximum number of iterations. |
|
Methods to configure the cost function. Definition at line 133 of file itkSPSAOptimizer.h. References MaximizeOn(). |
|
Set/Get the minimum number of iterations |
|
Set/Get the number of perturbation used to construct a gradient estimate g_k. q = NumberOfPerturbations g_k = 1/q sum_{j=1..q} g^(j)_k |
|
Set/Get StateOfConvergenceDecayRate (number between 0 and 1). |
|
Set/Get Tolerance |
|
Start optimization. Reimplemented from itk::Optimizer. |
|
Stop optimization.
|
|
Definition at line 199 of file itkSPSAOptimizer.h. Referenced by ~SPSAOptimizer(). |
|
Definition at line 195 of file itkSPSAOptimizer.h. |
|
Variables updated during optimization Definition at line 193 of file itkSPSAOptimizer.h. |
|
Definition at line 194 of file itkSPSAOptimizer.h. |
|
Definition at line 198 of file itkSPSAOptimizer.h. Referenced by ~SPSAOptimizer(). |
|
Definition at line 196 of file itkSPSAOptimizer.h. |
|
Definition at line 197 of file itkSPSAOptimizer.h. |