Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::SPSAOptimizer Class Reference
[Optimizers]

An optimizer based on simultaneous perturbation... More...

#include <itkSPSAOptimizer.h>

Inheritance diagram for itk::SPSAOptimizer:

Inheritance graph
[legend]
Collaboration diagram for itk::SPSAOptimizer:

Collaboration graph
[legend]
List of all members.

Public Types

typedef SPSAOptimizer Self
typedef SingleValuedNonLinearOptimizer Superclass
typedef SmartPointer< SelfPointer
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 &parameters) 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 DerivativeTypeGetGradient ()
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 &parameters, 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

Detailed Description

An optimizer based on simultaneous perturbation...

This optimizer is an implementation of the Simultaneous Perturbation Stochastic Approximation method, described in:

Definition at line 26 of file itkSPSAOptimizer.h.


Member Typedef Documentation

typedef SmartPointer<const Self> itk::SPSAOptimizer::ConstPointer
 

Reimplemented from itk::SingleValuedNonLinearOptimizer.

Definition at line 35 of file itkSPSAOptimizer.h.

typedef SmartPointer<Self> itk::SPSAOptimizer::Pointer
 

Reimplemented from itk::SingleValuedNonLinearOptimizer.

Definition at line 34 of file itkSPSAOptimizer.h.

typedef SPSAOptimizer itk::SPSAOptimizer::Self
 

Standard class typedefs.

Reimplemented from itk::SingleValuedNonLinearOptimizer.

Definition at line 32 of file itkSPSAOptimizer.h.

typedef SingleValuedNonLinearOptimizer itk::SPSAOptimizer::Superclass
 

Reimplemented from itk::SingleValuedNonLinearOptimizer.

Definition at line 33 of file itkSPSAOptimizer.h.


Member Enumeration Documentation

enum itk::SPSAOptimizer::StopConditionType
 

Codes of stopping conditions

Enumeration values:
Unknown 
MaximumNumberOfIterations 
BelowTolerance 
MetricError 

Definition at line 44 of file itkSPSAOptimizer.h.


Constructor & Destructor Documentation

itk::SPSAOptimizer::SPSAOptimizer  )  [protected]
 

virtual itk::SPSAOptimizer::~SPSAOptimizer  )  [inline, protected, virtual]
 

Definition at line 187 of file itkSPSAOptimizer.h.

References m_CurrentIteration, and m_StateOfConvergence.


Member Function Documentation

virtual void itk::SPSAOptimizer::AdvanceOneStep void   )  [virtual]
 

Advance one step following the gradient direction.

virtual double itk::SPSAOptimizer::Compute_a unsigned long  k  )  const [protected, virtual]
 

Method to compute the learning rate at iteration k (a_k).

virtual double itk::SPSAOptimizer::Compute_c unsigned long  k  )  const [protected, virtual]
 

Method to compute the gain factor for the perturbation at iteration k (c_k).

virtual void itk::SPSAOptimizer::ComputeGradient const ParametersType parameters,
DerivativeType gradient
[protected, virtual]
 

Compute the gradient at a position. m_NumberOfPerturbations are used, and scales are taken into account.

virtual void itk::SPSAOptimizer::GenerateDelta const unsigned int  spaceDimension  )  [protected, virtual]
 

Method to generate a perturbation vector. Takes scales into account.

virtual double itk::SPSAOptimizer::GetA  )  const [virtual]
 

Set/Get A.

virtual double itk::SPSAOptimizer::Geta  )  const [virtual]
 

Set/Get a.

virtual double itk::SPSAOptimizer::GetAlpha  )  const [virtual]
 

Set/Get alpha.

virtual double itk::SPSAOptimizer::Getc  )  const [virtual]
 

Set/Get c.

virtual unsigned long itk::SPSAOptimizer::GetCurrentIteration  )  const [virtual]
 

Get the current iteration number.

virtual double itk::SPSAOptimizer::GetGamma  )  const [virtual]
 

Set/Get gamma.

virtual const DerivativeType& itk::SPSAOptimizer::GetGradient  )  [virtual]
 

Get the latest computed gradient

virtual double itk::SPSAOptimizer::GetGradientMagnitude  )  const [virtual]
 

Get the GradientMagnitude of the latest computed gradient

virtual double itk::SPSAOptimizer::GetLearningRate  )  const [virtual]
 

Get the current LearningRate (a_k)

virtual bool itk::SPSAOptimizer::GetMaximize  )  const [virtual]
 

Methods to configure the cost function.

virtual unsigned long itk::SPSAOptimizer::GetMaximumNumberOfIterations  )  const [virtual]
 

Set/Get the maximum number of iterations.

bool itk::SPSAOptimizer::GetMinimize  )  const [inline]
 

Methods to configure the cost function.

Definition at line 131 of file itkSPSAOptimizer.h.

References MaximizeOff().

virtual unsigned long itk::SPSAOptimizer::GetMinimumNumberOfIterations  )  const [virtual]
 

Set/Get the minimum number of iterations

virtual const char* itk::SPSAOptimizer::GetNameOfClass  )  const [virtual]
 

Run-time type information (and related methods).

Reimplemented from itk::SingleValuedNonLinearOptimizer.

virtual unsigned long itk::SPSAOptimizer::GetNumberOfPerturbations  )  const [virtual]
 

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

virtual double itk::SPSAOptimizer::GetStateOfConvergence  )  const [virtual]
 

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

virtual double itk::SPSAOptimizer::GetStateOfConvergenceDecayRate  )  const [virtual]
 

Set/Get StateOfConvergenceDecayRate (number between 0 and 1).

virtual StopConditionType itk::SPSAOptimizer::GetStopCondition  )  const [virtual]
 

Get Stop condition.

virtual double itk::SPSAOptimizer::GetTolerance  )  const [virtual]
 

Set/Get Tolerance

virtual MeasureType itk::SPSAOptimizer::GetValue const ParametersType parameters  )  const [virtual]
 

Get the cost function value at any position

Reimplemented from itk::SingleValuedNonLinearOptimizer.

virtual MeasureType itk::SPSAOptimizer::GetValue void   )  const [virtual]
 

Get the cost function value at the current position.

virtual void itk::SPSAOptimizer::GuessParameters unsigned long  numberOfGradientEstimates,
double  initialStepSize
[virtual]
 

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.

virtual void itk::SPSAOptimizer::MaximizeOff  )  [virtual]
 

Methods to configure the cost function.

Referenced by GetMinimize().

virtual void itk::SPSAOptimizer::MaximizeOn  )  [virtual]
 

Methods to configure the cost function.

Referenced by SetMinimize().

void itk::SPSAOptimizer::MinimizeOff void   )  [inline]
 

Methods to configure the cost function.

Definition at line 137 of file itkSPSAOptimizer.h.

void itk::SPSAOptimizer::MinimizeOn void   )  [inline]
 

Methods to configure the cost function.

Definition at line 135 of file itkSPSAOptimizer.h.

Pointer itk::SPSAOptimizer::New  )  [static]
 

Method for creation through the object factory.

Reimplemented from itk::SingleValuedNonLinearOptimizer.

void itk::SPSAOptimizer::PrintSelf std::ostream &  os,
Indent  indent
const [protected, virtual]
 

PrintSelf method.

Reimplemented from itk::SingleValuedNonLinearOptimizer.

void itk::SPSAOptimizer::ResumeOptimization void   ) 
 

Resume previously stopped optimization with current parameters

See also:
StopOptimization.

virtual void itk::SPSAOptimizer::SetA double  _arg  )  [virtual]
 

Set/Get A.

virtual void itk::SPSAOptimizer::Seta double  _arg  )  [virtual]
 

Set/Get a.

virtual void itk::SPSAOptimizer::SetAlpha double  _arg  )  [virtual]
 

Set/Get alpha.

virtual void itk::SPSAOptimizer::Setc double  _arg  )  [virtual]
 

Set/Get c.

virtual void itk::SPSAOptimizer::SetGamma double  _arg  )  [virtual]
 

Set/Get gamma.

virtual void itk::SPSAOptimizer::SetMaximize bool  _arg  )  [virtual]
 

Methods to configure the cost function.

virtual void itk::SPSAOptimizer::SetMaximumNumberOfIterations unsigned long  _arg  )  [virtual]
 

Set/Get the maximum number of iterations.

void itk::SPSAOptimizer::SetMinimize bool  v  )  [inline]
 

Methods to configure the cost function.

Definition at line 133 of file itkSPSAOptimizer.h.

References MaximizeOn().

virtual void itk::SPSAOptimizer::SetMinimumNumberOfIterations unsigned long  _arg  )  [virtual]
 

Set/Get the minimum number of iterations

virtual void itk::SPSAOptimizer::SetNumberOfPerturbations unsigned long  _arg  )  [virtual]
 

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

virtual void itk::SPSAOptimizer::SetStateOfConvergenceDecayRate double  _arg  )  [virtual]
 

Set/Get StateOfConvergenceDecayRate (number between 0 and 1).

virtual void itk::SPSAOptimizer::SetTolerance double  _arg  )  [virtual]
 

Set/Get Tolerance

void itk::SPSAOptimizer::StartOptimization void   )  [virtual]
 

Start optimization.

Reimplemented from itk::Optimizer.

void itk::SPSAOptimizer::StopOptimization void   ) 
 

Stop optimization.

See also:
ResumeOptimization


Member Data Documentation

unsigned long itk::SPSAOptimizer::m_CurrentIteration [protected]
 

Definition at line 199 of file itkSPSAOptimizer.h.

Referenced by ~SPSAOptimizer().

DerivativeType itk::SPSAOptimizer::m_Delta [protected]
 

Definition at line 195 of file itkSPSAOptimizer.h.

DerivativeType itk::SPSAOptimizer::m_Gradient [protected]
 

Variables updated during optimization

Definition at line 193 of file itkSPSAOptimizer.h.

double itk::SPSAOptimizer::m_LearningRate [protected]
 

Definition at line 194 of file itkSPSAOptimizer.h.

double itk::SPSAOptimizer::m_StateOfConvergence [protected]
 

Definition at line 198 of file itkSPSAOptimizer.h.

Referenced by ~SPSAOptimizer().

bool itk::SPSAOptimizer::m_Stop [protected]
 

Definition at line 196 of file itkSPSAOptimizer.h.

StopConditionType itk::SPSAOptimizer::m_StopCondition [protected]
 

Definition at line 197 of file itkSPSAOptimizer.h.


The documentation for this class was generated from the following file:
Generated at Thu May 25 02:25:58 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000