ITK
4.4.0
Insight Segmentation and Registration Toolkit
|
#include <itkGradientDescentOptimizerBasev4.h>
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 Member Functions | |
virtual SizeValueType | GetCurrentIteration () const |
virtual const DerivativeType & | GetGradient () |
virtual const char * | GetNameOfClass () const |
virtual const SizeValueType & | GetNumberOfIterations () |
virtual const StopConditionType & | GetStopCondition () |
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 MeasureType & | GetCurrentMetricValue () |
const ParametersType & | GetCurrentPosition () |
virtual const ThreadIdType & | GetNumberOfThreads () |
virtual const ScalesType & | GetScales () |
virtual const bool & | GetScalesAreIdentity () |
const MeasureType & | GetValue () |
virtual const ScalesType & | GetWeights () |
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 void | SetMetric (MetricType *_arg) |
virtual MetricType * | GetModifiableMetric () |
virtual const MetricType * | GetMetric () const |
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 |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary (void) |
const MetaDataDictionary & | GetMetaDataDictionary (void) const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () 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 () |
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) |
typedef SmartPointer< const Self > itk::GradientDescentOptimizerBasev4::ConstPointer |
Definition at line 46 of file itkGradientDescentOptimizerBasev4.h.
Derivative type
Definition at line 73 of file itkGradientDescentOptimizerBasev4.h.
|
protected |
Definition at line 134 of file itkGradientDescentOptimizerBasev4.h.
typedef Superclass::InternalComputationValueType itk::GradientDescentOptimizerBasev4::InternalComputationValueType |
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.
typedef std::ostringstream itk::GradientDescentOptimizerBasev4::StopConditionDescriptionType |
Stop condition internal string type
Definition at line 66 of file itkGradientDescentOptimizerBasev4.h.
typedef std::string itk::GradientDescentOptimizerBasev4::StopConditionReturnStringType |
Stop condition return string type
Definition at line 63 of file itkGradientDescentOptimizerBasev4.h.
Definition at line 44 of file itkGradientDescentOptimizerBasev4.h.
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.
|
protected |
Default constructor
|
protectedvirtual |
Default constructor
|
private |
|
virtual |
Get the current iteration number.
Reimplemented in itk::MultiGradientOptimizerv4.
|
virtual |
Get the most recent gradient values.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ObjectToObjectOptimizerBase.
Reimplemented in itk::GradientDescentOptimizerv4, itk::QuasiNewtonOptimizerv4, itk::GradientDescentLineSearchOptimizerv4, itk::ConjugateGradientLineSearchOptimizerv4, and itk::MultiGradientOptimizerv4.
|
virtual |
Get the number of iterations.
Reimplemented in itk::MultiGradientOptimizerv4.
|
virtual |
Get stop condition enum
Reimplemented in itk::MultiGradientOptimizerv4.
|
virtual |
Get the reason for termination
Reimplemented in itk::MultiGradientOptimizerv4.
|
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.
|
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 |
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.
|
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.
|
private |
|
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.
|
pure virtual |
Resume optimization. This runs the optimization loop, and allows continuation of stopped optimization
Implemented in itk::GradientDescentOptimizerv4, and itk::MultiGradientOptimizerv4.
|
virtual |
Set the number of iterations.
Reimplemented in itk::MultiGradientOptimizerv4.
|
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.
|
friend |
Definition at line 132 of file itkGradientDescentOptimizerBasev4.h.
|
friend |
Definition at line 131 of file itkGradientDescentOptimizerBasev4.h.
|
protected |
Definition at line 158 of file itkGradientDescentOptimizerBasev4.h.
|
protected |
Current gradient
Definition at line 161 of file itkGradientDescentOptimizerBasev4.h.
|
protected |
Definition at line 137 of file itkGradientDescentOptimizerBasev4.h.
|
protected |
Definition at line 136 of file itkGradientDescentOptimizerBasev4.h.
|
protected |
Definition at line 157 of file itkGradientDescentOptimizerBasev4.h.
|
protected |
Definition at line 154 of file itkGradientDescentOptimizerBasev4.h.
|
protected |
Definition at line 155 of file itkGradientDescentOptimizerBasev4.h.
|
protected |
Definition at line 156 of file itkGradientDescentOptimizerBasev4.h.