ITK
5.2.0
Insight Toolkit
|
#include <itkObjectToObjectOptimizerBase.h>
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 val) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Member Functions inherited from itk::Object | |
Object () | |
~Object () override | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
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 inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount |
Abstract base for object-to-object optimizers.
The goal of this optimizer hierarchy is to work with metrics of any type, i.e. working with any kind of object, such as image or point-set.
Transform parameters are not manipulated directly. Instead, the optimizer retrieves the metric derivative from the metric, modifies the derivative as required, then passes it back to the metric as an update. The metric then processes it as appropriate, typically by passing it to its transform that is being optimized.
The user can scale each component of the gradient (derivative) at each iteration in one of two ways:
1) manually, by setting a scaling vector using method SetScales(). SetScales() allows setting of a per-local-parameter scaling array. If unset, the m_Scales
array will be initialized to all 1's. Note that when used with transforms with local support, these scales correspond to each local parameter, and not to each parameter. For example, in a DisplacementFieldTransform of dimensionality N, the Scales is size N, with each element corresponding to a dimension within the transform's displacement field, and is applied to each vector in the displacement field.
or,
2) automatically, by assigning a ScalesEstimator using SetScalesEstimator(). When ScalesEstimator is assigned, the optimizer is enabled by default to estimate scales, and can be changed via SetDoEstimateScales(). The scales are estimated and assigned once, during the call to StartOptimization(). This option will override any manually-assigned scales.
SetWeights() allows setting of a per-local-parameter weighting array. If unset, the weights are treated as identity. Weights are multiplied by the gradient at the same time scaling is applied. Weights are different than scales, and may be used, for example, to easily mask out a particular parameter during optimization to hold it constant. Or they may be used to apply another kind of prior knowledge.
Threading of some optimizer operations may be handled within derived classes, for example in GradientDescentOptimizer.
Definition at line 113 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::ConstPointer = SmartPointer<const Self> |
Definition at line 122 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::DerivativeType = typename MetricType::DerivativeType |
Derivative type
Definition at line 139 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::MeasureType = typename MetricType::MeasureType |
Measure type
Definition at line 145 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::MetricType = ObjectToObjectMetricBaseTemplate<TInternalComputationValueType> |
Metric function type
Definition at line 135 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::MetricTypePointer = typename MetricType::Pointer |
Definition at line 136 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::NumberOfParametersType = typename MetricType::NumberOfParametersType |
Number of parameters type
Definition at line 142 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::ParametersType = OptimizerParameters<TInternalComputationValueType> |
Parameters type.
Definition at line 132 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::Pointer = SmartPointer<Self> |
Definition at line 121 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::ScalesEstimatorType = OptimizerParameterScalesEstimatorTemplate<TInternalComputationValueType> |
Definition at line 129 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::ScalesType = OptimizerParameters<TInternalComputationValueType> |
Scale type.
Definition at line 128 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::Self = ObjectToObjectOptimizerBaseTemplate |
Standard class type aliases.
Definition at line 119 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::StopConditionDescriptionType = std::ostringstream |
Stop condition internal string type
Definition at line 151 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::StopConditionReturnStringType = std::string |
Stop condition return string type
Definition at line 148 of file itkObjectToObjectOptimizerBase.h.
using itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::Superclass = Object |
Definition at line 120 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Default constructor
|
overrideprotected |
Metric measure value at a given iteration, as most recently evaluated.
|
virtual |
Metric measure value at a given iteration, as most recently evaluated.
|
virtual |
Metric measure value at a given iteration, as most recently evaluated.
|
virtual |
Return current number of iterations.
Reimplemented in itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >.
|
virtual |
Accessor for metric value. Returns the value stored in m_CurrentMetricValue from the most recent call to evaluate the metric.
|
virtual |
Get a reference to the current position of the optimization. This returns the parameters from the assigned metric, since the optimizer itself does not store a position.
|
virtual |
Metric measure value at a given iteration, as most recently evaluated.
|
virtual |
Metric measure value at a given iteration, as most recently evaluated.
|
virtual |
Metric measure value at a given iteration, as most recently evaluated.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::Object.
Reimplemented in itk::LBFGS2Optimizerv4, itk::LBFGSOptimizerv4, itk::ExhaustiveOptimizerv4< TInternalComputationValueType >, itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >, itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >, itk::LBFGSOptimizerBasev4< vnl_lbfgs >, itk::LBFGSOptimizerBasev4< vnl_lbfgsb >, itk::LBFGSBOptimizerv4, itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >, itk::AmoebaOptimizerv4, itk::QuasiNewtonOptimizerv4Template< TInternalComputationValueType >, itk::GradientDescentLineSearchOptimizerv4Template< TInternalComputationValueType >, itk::PowellOptimizerv4< TInternalComputationValueType >, itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >, itk::MultiGradientOptimizerv4Template< TInternalComputationValueType >, itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >, itk::MultiStartOptimizerv4Template< TInternalComputationValueType >, itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >, and itk::SingleValuedNonLinearVnlOptimizerv4.
|
virtual |
Get the number of iterations.
Reimplemented in itk::LBFGS2Optimizerv4, and itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >.
|
virtual |
Get the number of work units set to be used.
|
virtual |
Get current parameters scaling.
|
virtual |
Get whether scales are identity. Cannot be set
bool itk::ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType >::GetScalesInitialized | ( | ) | const |
Get whether the scales have been set. Returns true if m_Scales.Size() > 0
|
pure virtual |
Stop condition return string type
Implemented in itk::SingleValuedNonLinearVnlOptimizerv4, itk::LBFGS2Optimizerv4, itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >, itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >, itk::AmoebaOptimizerv4, itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >, itk::LBFGSOptimizerBasev4< vnl_lbfgs >, itk::LBFGSOptimizerBasev4< vnl_lbfgsb >, itk::PowellOptimizerv4< TInternalComputationValueType >, itk::ExhaustiveOptimizerv4< TInternalComputationValueType >, itk::MultiStartOptimizerv4Template< TInternalComputationValueType >, and itk::MultiGradientOptimizerv4Template< TInternalComputationValueType >.
|
virtual |
Deprecated accessor for currently stored metric value for use by classes that support both v4 and v3 optimizers.
Reimplemented in itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >, and itk::PowellOptimizerv4< TInternalComputationValueType >.
|
virtual |
Get current parameters weights. This will return an empty array when weights have not been set by user.
|
virtual |
Get whether weights are identity. Cannot be set
|
overrideprotectedvirtual |
Metric measure value at a given iteration, as most recently evaluated.
Reimplemented from itk::Object.
Reimplemented in itk::QuasiNewtonOptimizerv4Template< TInternalComputationValueType >, itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >, itk::PowellOptimizerv4< TInternalComputationValueType >, and itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >.
|
virtual |
Option to use ScalesEstimator for scales estimation. The estimation is performed once at begin of optimization, and overrides any scales set using SetScales(). Default is true.
|
virtual |
Accessors for Metric
|
virtual |
Set the number of iterations.
Reimplemented in itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >, and itk::LBFGS2Optimizerv4.
|
virtual |
Set the number of work units to use when threading. The default is the global default number of work units decided in the constructor of the MultiThreader.
|
inlinevirtual |
Set current parameters scaling.
Definition at line 174 of file itkObjectToObjectOptimizerBase.h.
|
virtual |
Set the scales estimator.
A ScalesEstimator is required for the scales estimation options to work. See the main documentation. Derived classes may also provide learning-rate estimation, in which case a scales estimator is also required.
|
virtual |
Set current parameters weights.
|
virtual |
Run the optimization.
doOnlyInitialization | This is false by default. It should only be set to true for special cases when the class should be initialized to perform optimization, but no optimization should be run. For example, itkMultiGradientOptimizerv4 needs to do this. |
Reimplemented in itk::LBFGS2Optimizerv4, itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >, itk::OnePlusOneEvolutionaryOptimizerv4< TInternalComputationValueType >, itk::GradientDescentOptimizerBasev4Template< TInternalComputationValueType >, itk::PowellOptimizerv4< TInternalComputationValueType >, itk::LBFGSBOptimizerv4, itk::MultiStartOptimizerv4Template< TInternalComputationValueType >, itk::ExhaustiveOptimizerv4< TInternalComputationValueType >, itk::RegularStepGradientDescentOptimizerv4< TInternalComputationValueType >, itk::LBFGSOptimizerv4, itk::LBFGSOptimizerBasev4< TInternalVnlOptimizerType >, itk::LBFGSOptimizerBasev4< vnl_lbfgs >, itk::LBFGSOptimizerBasev4< vnl_lbfgsb >, itk::MultiGradientOptimizerv4Template< TInternalComputationValueType >, itk::QuasiNewtonOptimizerv4Template< TInternalComputationValueType >, itk::AmoebaOptimizerv4, itk::ConjugateGradientLineSearchOptimizerv4Template< TInternalComputationValueType >, and itk::SingleValuedNonLinearVnlOptimizerv4.
|
protected |
Metric measure value at a given iteration, as most recently evaluated.
Definition at line 277 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Metric measure value at a given iteration, as most recently evaluated.
Definition at line 281 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Flag to control use of the ScalesEstimator (if set) for automatic scale estimation during StartOptimization()
Definition at line 305 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Metric measure value at a given iteration, as most recently evaluated.
Definition at line 275 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Metric measure value at a given iteration, as most recently evaluated.
Definition at line 278 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Metric measure value at a given iteration, as most recently evaluated.
Definition at line 276 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Scales. Size is expected to be == metric->GetNumberOfLocalParameters(). See the main documentation for more details.
Definition at line 285 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Flag to avoid unnecessary arithmetic when scales are identity.
Definition at line 294 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Scales estimator. Optionally provided by user.
Definition at line 297 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Parameter weights. These are applied to local parameters, at the same time as scales. See main documentation. If not set by user, the array remains empty and treated as identity to simplify the reuse of an optimizer with transforms with different numbers of parameters.
Definition at line 291 of file itkObjectToObjectOptimizerBase.h.
|
protected |
Flag to avoid unnecessary arithmetic when weights are identity.
Definition at line 300 of file itkObjectToObjectOptimizerBase.h.