ITK  4.3.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
itk::GradientDescentOptimizerBasev4 Class Referenceabstract

#include <itkGradientDescentOptimizerBasev4.h>

+ Inheritance diagram for itk::GradientDescentOptimizerBasev4:
+ Collaboration diagram for itk::GradientDescentOptimizerBasev4:

Detailed Description

Abstract base class for gradient descent-style optimizers.

Gradient modification is threaded in ModifyGradient.

Derived classes must override ModifyGradientByScalesOverSubRange, ModifyGradientByLearningRateOverSubRange and ResumeOptimization.

Definition at line 38 of file itkGradientDescentOptimizerBasev4.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef MetricType::DerivativeType DerivativeType
 
typedef
Superclass::InternalComputationValueType 
InternalComputationValueType
 
typedef Superclass::MeasureType MeasureType
 
typedef Superclass::MetricType MetricType
 
typedef MetricType::Pointer MetricTypePointer
 
typedef SmartPointer< SelfPointer
 
typedef
GradientDescentOptimizerBasev4 
Self
 
typedef std::ostringstream StopConditionDescriptionType
 
typedef std::string StopConditionReturnStringType
 
enum  StopConditionType {
  MAXIMUM_NUMBER_OF_ITERATIONS,
  COSTFUNCTION_ERROR,
  UPDATE_PARAMETERS_ERROR,
  STEP_TOO_SMALL,
  QUASI_NEWTON_STEP_ERROR,
  CONVERGENCE_CHECKER_PASSED,
  OTHER_ERROR
}
 
typedef ObjectToObjectOptimizerBase Superclass
 
- Public Types inherited from itk::ObjectToObjectOptimizerBase
typedef SmartPointer< const SelfConstPointer
 
typedef
MetricType::InternalComputationValueType 
InternalComputationValueType
 
typedef MetricType::MeasureType MeasureType
 
typedef ObjectToObjectMetricBase MetricType
 
typedef MetricType::Pointer MetricTypePointer
 
typedef
MetricType::NumberOfParametersType 
NumberOfParametersType
 
typedef OptimizerParameters
< double > 
ParametersType
 
typedef SmartPointer< SelfPointer
 
typedef OptimizerParameters
< double > 
ScalesType
 
typedef ObjectToObjectOptimizerBase Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual SizeValueType GetCurrentIteration () const
 
virtual const DerivativeTypeGetGradient ()
 
virtual const char * GetNameOfClass () const
 
virtual const SizeValueTypeGetNumberOfIterations ()
 
virtual const StopConditionTypeGetStopCondition ()
 
virtual const
StopConditionReturnStringType 
GetStopConditionDescription () const
 
virtual void ResumeOptimization ()=0
 
virtual void SetNumberOfIterations (SizeValueType _arg)
 
virtual void StopOptimization (void)
 
virtual void ModifyGradientByScales ()
 
virtual void ModifyGradientByLearningRate ()
 
- Public Member Functions inherited from itk::ObjectToObjectOptimizerBase
virtual const MeasureTypeGetCurrentMetricValue ()
 
const ParametersTypeGetCurrentPosition ()
 
virtual const ThreadIdTypeGetNumberOfThreads ()
 
virtual const ScalesTypeGetScales ()
 
virtual const bool & GetScalesAreIdentity ()
 
const MeasureTypeGetValue ()
 
virtual const ScalesTypeGetWeights ()
 
virtual const bool & GetWeightsAreIdentity ()
 
virtual void SetNumberOfThreads (ThreadIdType number)
 
virtual void SetScales (ScalesType _arg)
 
virtual void SetWeights (ScalesType _arg)
 
virtual void StartOptimization (bool doOnlyInitialization=false)
 
virtual MetricTypeGetMetric ()
 
virtual void SetMetric (MetricType *_arg)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual LightObject::Pointer CreateAnother () const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary (void)
 
const MetaDataDictionaryGetMetaDataDictionary (void) const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int)
 
virtual void UnRegister () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Protected Types

typedef
GradientDescentOptimizerBasev4ModifyGradientByScalesThreader::IndexRangeType 
IndexRangeType
 

Protected Member Functions

virtual void ModifyGradientByLearningRateOverSubRange (const IndexRangeType &subrange)=0
 
virtual void ModifyGradientByScalesOverSubRange (const IndexRangeType &subrange)=0
 
virtual void PrintSelf (std::ostream &os, Indent indent) const
 
 GradientDescentOptimizerBasev4 ()
 
virtual ~GradientDescentOptimizerBasev4 ()
 
- Protected Member Functions inherited from itk::ObjectToObjectOptimizerBase
 ObjectToObjectOptimizerBase ()
 
virtual ~ObjectToObjectOptimizerBase ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Protected Attributes

SizeValueType m_CurrentIteration
 
DerivativeType m_Gradient
 
GradientDescentOptimizerBasev4ModifyGradientByLearningRateThreader::Pointer m_ModifyGradientByLearningRateThreader
 
GradientDescentOptimizerBasev4ModifyGradientByScalesThreader::Pointer m_ModifyGradientByScalesThreader
 
SizeValueType m_NumberOfIterations
 
bool m_Stop
 
StopConditionType m_StopCondition
 
StopConditionDescriptionType m_StopConditionDescription
 
- Protected Attributes inherited from itk::ObjectToObjectOptimizerBase
MeasureType m_CurrentMetricValue
 
MetricTypePointer m_Metric
 
ThreadIdType m_NumberOfThreads
 
ScalesType m_Scales
 
bool m_ScalesAreIdentity
 
ScalesType m_Weights
 
bool m_WeightsAreIdentity
 

Private Member Functions

 GradientDescentOptimizerBasev4 (const Self &)
 
void operator= (const Self &)
 

Friends

class GradientDescentOptimizerBasev4ModifyGradientByLearningRateThreader
 
class GradientDescentOptimizerBasev4ModifyGradientByScalesThreader
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 

Member Typedef Documentation

Definition at line 46 of file itkGradientDescentOptimizerBasev4.h.

Derivative type

Definition at line 73 of file itkGradientDescentOptimizerBasev4.h.

Definition at line 134 of file itkGradientDescentOptimizerBasev4.h.

Internal computation type, for maintaining a desired precision

Definition at line 79 of file itkGradientDescentOptimizerBasev4.h.

Measure type

Definition at line 76 of file itkGradientDescentOptimizerBasev4.h.

typedef Superclass::MetricType itk::GradientDescentOptimizerBasev4::MetricType

Metric type over which this class is templated

Definition at line 69 of file itkGradientDescentOptimizerBasev4.h.

Definition at line 70 of file itkGradientDescentOptimizerBasev4.h.

Definition at line 45 of file itkGradientDescentOptimizerBasev4.h.

Standard class typedefs.

Definition at line 43 of file itkGradientDescentOptimizerBasev4.h.

Stop condition internal string type

Definition at line 66 of file itkGradientDescentOptimizerBasev4.h.

Stop condition return string type

Definition at line 63 of file itkGradientDescentOptimizerBasev4.h.

Definition at line 44 of file itkGradientDescentOptimizerBasev4.h.

Member Enumeration Documentation

Codes of stopping conditions.

Enumerator:
MAXIMUM_NUMBER_OF_ITERATIONS 
COSTFUNCTION_ERROR 
UPDATE_PARAMETERS_ERROR 
STEP_TOO_SMALL 
QUASI_NEWTON_STEP_ERROR 
CONVERGENCE_CHECKER_PASSED 
OTHER_ERROR 

Definition at line 52 of file itkGradientDescentOptimizerBasev4.h.

Constructor & Destructor Documentation

itk::GradientDescentOptimizerBasev4::GradientDescentOptimizerBasev4 ( )
protected

Default constructor

virtual itk::GradientDescentOptimizerBasev4::~GradientDescentOptimizerBasev4 ( )
protectedvirtual

Default constructor

itk::GradientDescentOptimizerBasev4::GradientDescentOptimizerBasev4 ( const Self )
private

Member Function Documentation

virtual SizeValueType itk::GradientDescentOptimizerBasev4::GetCurrentIteration ( ) const
virtual

Get the current iteration number.

Reimplemented in itk::MultiGradientOptimizerv4.

virtual const DerivativeType& itk::GradientDescentOptimizerBasev4::GetGradient ( )
virtual

Get the most recent gradient values.

virtual const char* itk::GradientDescentOptimizerBasev4::GetNameOfClass ( ) const
virtual
virtual const SizeValueType& itk::GradientDescentOptimizerBasev4::GetNumberOfIterations ( )
virtual

Get the number of iterations.

Reimplemented in itk::MultiGradientOptimizerv4.

virtual const StopConditionType& itk::GradientDescentOptimizerBasev4::GetStopCondition ( )
virtual

Get stop condition enum

Reimplemented in itk::MultiGradientOptimizerv4.

virtual const StopConditionReturnStringType itk::GradientDescentOptimizerBasev4::GetStopConditionDescription ( ) const
virtual

Get the reason for termination

Reimplemented in itk::MultiGradientOptimizerv4.

virtual void itk::GradientDescentOptimizerBasev4::ModifyGradientByLearningRate ( )
virtual

Modify the gradient in place, to advance the optimization. This call performs a threaded modification for transforms with local support (assumed to be dense). Otherwise the modification is performed w/out threading. See EstimateLearningRate() to perform optionaly learning rate estimation. At completion, m_Gradient can be used to update the transform parameters. Derived classes may hold additional results in other member variables.

See Also
EstimateLearningRate()
virtual void itk::GradientDescentOptimizerBasev4::ModifyGradientByLearningRateOverSubRange ( const IndexRangeType subrange)
protectedpure virtual

Derived classes define this worker method to modify the gradient by learning rates. Modifications must be performed over the index range defined in subrange. Called from ModifyGradientByLearningRate(), either directly or via threaded operation.

Implemented in itk::GradientDescentOptimizerv4.

virtual void itk::GradientDescentOptimizerBasev4::ModifyGradientByScales ( )
virtual

Modify the gradient in place, to advance the optimization. This call performs a threaded modification for transforms with local support (assumed to be dense). Otherwise the modification is performed w/out threading. See EstimateLearningRate() to perform optionaly learning rate estimation. At completion, m_Gradient can be used to update the transform parameters. Derived classes may hold additional results in other member variables.

See Also
EstimateLearningRate()
virtual void itk::GradientDescentOptimizerBasev4::ModifyGradientByScalesOverSubRange ( const IndexRangeType subrange)
protectedpure virtual

Derived classes define this worker method to modify the gradient by scales. Modifications must be performed over the index range defined in subrange. Called from ModifyGradientByScales(), either directly or via threaded operation.

Implemented in itk::GradientDescentOptimizerv4.

void itk::GradientDescentOptimizerBasev4::operator= ( const Self )
private
virtual void itk::GradientDescentOptimizerBasev4::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::ObjectToObjectOptimizerBase.

Reimplemented in itk::GradientDescentOptimizerv4, itk::QuasiNewtonOptimizerv4, itk::MultiGradientOptimizerv4, itk::GradientDescentLineSearchOptimizerv4, and itk::ConjugateGradientLineSearchOptimizerv4.

virtual void itk::GradientDescentOptimizerBasev4::ResumeOptimization ( )
pure virtual

Resume optimization. This runs the optimization loop, and allows continuation of stopped optimization

Implemented in itk::GradientDescentOptimizerv4, and itk::MultiGradientOptimizerv4.

virtual void itk::GradientDescentOptimizerBasev4::SetNumberOfIterations ( SizeValueType  _arg)
virtual

Set the number of iterations.

Reimplemented in itk::MultiGradientOptimizerv4.

virtual void itk::GradientDescentOptimizerBasev4::StopOptimization ( void  )
virtual

Stop optimization. The object is left in a state so the optimization can be resumed by calling ResumeOptimization.

Reimplemented in itk::GradientDescentOptimizerv4, and itk::MultiGradientOptimizerv4.

Friends And Related Function Documentation

Definition at line 132 of file itkGradientDescentOptimizerBasev4.h.

Definition at line 131 of file itkGradientDescentOptimizerBasev4.h.

Member Data Documentation

SizeValueType itk::GradientDescentOptimizerBasev4::m_CurrentIteration
protected

Definition at line 158 of file itkGradientDescentOptimizerBasev4.h.

DerivativeType itk::GradientDescentOptimizerBasev4::m_Gradient
protected

Current gradient

Definition at line 161 of file itkGradientDescentOptimizerBasev4.h.

GradientDescentOptimizerBasev4ModifyGradientByLearningRateThreader::Pointer itk::GradientDescentOptimizerBasev4::m_ModifyGradientByLearningRateThreader
protected

Definition at line 137 of file itkGradientDescentOptimizerBasev4.h.

GradientDescentOptimizerBasev4ModifyGradientByScalesThreader::Pointer itk::GradientDescentOptimizerBasev4::m_ModifyGradientByScalesThreader
protected

Definition at line 136 of file itkGradientDescentOptimizerBasev4.h.

SizeValueType itk::GradientDescentOptimizerBasev4::m_NumberOfIterations
protected

Definition at line 157 of file itkGradientDescentOptimizerBasev4.h.

bool itk::GradientDescentOptimizerBasev4::m_Stop
protected

Definition at line 154 of file itkGradientDescentOptimizerBasev4.h.

StopConditionType itk::GradientDescentOptimizerBasev4::m_StopCondition
protected

Definition at line 155 of file itkGradientDescentOptimizerBasev4.h.

StopConditionDescriptionType itk::GradientDescentOptimizerBasev4::m_StopConditionDescription
protected

Definition at line 156 of file itkGradientDescentOptimizerBasev4.h.


The documentation for this class was generated from the following file: