#include <itkScaledSingleValuedNonLinearOptimizer.h>
Optimizers that inherit from this class optimize a scaled cost function instead of the original function :
where are the scaled parameters, the original parameters and the scales.
During optimization the inheriting classes should update the ScaledCurrentPosition ( ) instead of the CurrentPosition ( ).
When an optimizer needs the value at a (scaled) position , it should use the function this->GetScaledValue( ) instead of the GetValue method. Similar for the derivative.
Typically, in StartOptimization() the following line should be present:
this->SetCurrentPosition(this->GetInitialPosition);
This makes sure that the initial position , where is the initial (unscaled) position entered by the user.
Note that:
Definition at line 62 of file itkScaledSingleValuedNonLinearOptimizer.h.
Public Types | |
using | ConstPointer = SmartPointer<const Self> |
using | Pointer = SmartPointer<Self> |
using | ScaledCostFunctionPointer = ScaledCostFunctionType::Pointer |
using | ScaledCostFunctionType = ScaledSingleValuedCostFunction |
using | ScalesType = NonLinearOptimizer::ScalesType |
using | Self = ScaledSingleValuedNonLinearOptimizer |
using | Superclass = SingleValuedNonLinearOptimizer |
Public Member Functions | |
virtual const char * | GetClassName () const |
const ParametersType & | GetCurrentPosition () const override |
virtual bool | GetMaximize () const |
virtual const ScaledCostFunctionType * | GetScaledCostFunction () |
virtual const ParametersType & | GetScaledCurrentPosition () |
bool | GetUseScales () const |
virtual void | InitializeScales () |
ITK_DISALLOW_COPY_AND_MOVE (ScaledSingleValuedNonLinearOptimizer) | |
virtual void | MaximizeOff () |
virtual void | MaximizeOn () |
void | SetCostFunction (CostFunctionType *costFunction) override |
virtual void | SetMaximize (bool _arg) |
virtual void | SetUseScales (bool arg) |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
virtual void | GetScaledDerivative (const ParametersType ¶meters, DerivativeType &derivative) const |
virtual MeasureType | GetScaledValue (const ParametersType ¶meters) const |
virtual void | GetScaledValueAndDerivative (const ParametersType ¶meters, MeasureType &value, DerivativeType &derivative) const |
void | PrintSelf (std::ostream &os, Indent indent) const override |
ScaledSingleValuedNonLinearOptimizer () | |
void | SetCurrentPosition (const ParametersType ¶m) override |
virtual void | SetScaledCurrentPosition (const ParametersType ¶meters) |
~ScaledSingleValuedNonLinearOptimizer () override=default | |
Protected Attributes | |
ScaledCostFunctionPointer | m_ScaledCostFunction {} |
ParametersType | m_ScaledCurrentPosition {} |
Private Attributes | |
bool | m_Maximize {} |
ParametersType | m_UnscaledCurrentPosition {} |
using itk::ScaledSingleValuedNonLinearOptimizer::ConstPointer = SmartPointer<const Self> |
Definition at line 71 of file itkScaledSingleValuedNonLinearOptimizer.h.
using itk::ScaledSingleValuedNonLinearOptimizer::Pointer = SmartPointer<Self> |
Definition at line 70 of file itkScaledSingleValuedNonLinearOptimizer.h.
using itk::ScaledSingleValuedNonLinearOptimizer::ScaledCostFunctionPointer = ScaledCostFunctionType::Pointer |
Definition at line 87 of file itkScaledSingleValuedNonLinearOptimizer.h.
using itk::ScaledSingleValuedNonLinearOptimizer::ScaledCostFunctionType = ScaledSingleValuedCostFunction |
Definition at line 86 of file itkScaledSingleValuedNonLinearOptimizer.h.
using itk::ScaledSingleValuedNonLinearOptimizer::ScalesType = NonLinearOptimizer::ScalesType |
Definition at line 85 of file itkScaledSingleValuedNonLinearOptimizer.h.
Standard ITK-stuff.
Definition at line 68 of file itkScaledSingleValuedNonLinearOptimizer.h.
Definition at line 69 of file itkScaledSingleValuedNonLinearOptimizer.h.
|
protected |
The constructor.
|
overrideprotecteddefault |
The destructor.
|
virtual |
Run-time type information (and related methods).
Reimplemented in elastix::AdaGrad< TElastix >, elastix::AdaptiveStochasticGradientDescent< TElastix >, elastix::AdaptiveStochasticLBFGS< TElastix >, elastix::AdaptiveStochasticVarianceReducedGradient< TElastix >, elastix::CMAEvolutionStrategy< TElastix >, elastix::ConjugateGradient< TElastix >, elastix::FiniteDifferenceGradientDescent< TElastix >, elastix::PreconditionedStochasticGradientDescent< TElastix >, elastix::QuasiNewtonLBFGS< TElastix >, elastix::StandardGradientDescent< TElastix >, itk::AdaptiveStepsizeOptimizer, itk::AdaptiveStochasticGradientDescentOptimizer, itk::AdaptiveStochasticLBFGSOptimizer, itk::AdaptiveStochasticVarianceReducedGradientOptimizer, itk::CMAEvolutionStrategyOptimizer, itk::ComputeDisplacementDistribution< TFixedImage, TTransform >, itk::ComputePreconditionerUsingDisplacementDistribution< TFixedImage, TTransform >, itk::FiniteDifferenceGradientDescentOptimizer, itk::GenericConjugateGradientOptimizer, itk::GradientDescentOptimizer2, itk::PreconditionedASGDOptimizer, itk::QuasiNewtonLBFGSOptimizer, itk::StandardGradientDescentOptimizer, itk::StandardStochasticGradientOptimizer, itk::StandardStochasticVarianceReducedGradientOptimizer, itk::StochasticGradientDescentOptimizer, and itk::StochasticVarianceReducedGradientDescentOptimizer.
|
override |
Get the current unscaled position: get the ScaledCurrentPosition and divide each element through its scale.
|
virtual |
|
virtual |
Get a pointer to the scaled cost function.
|
virtual |
Get the current scaled position.
|
protectedvirtual |
Divide the (scaled) parameters by the scales, call the GetDerivative routine of the unscaled cost function and divide the resulting derivative by the scales.
|
protectedvirtual |
Divide the (scaled) parameters by the scales and call the GetValue routine of the unscaled cost function.
|
protectedvirtual |
Same procedure as in GetValue and GetDerivative.
bool itk::ScaledSingleValuedNonLinearOptimizer::GetUseScales | ( | ) | const |
|
virtual |
Configure the scaled cost function. This function sets the current scales in the ScaledCostFunction. NB: it assumes that the scales entered by the user are the squared scales (following the ITK convention). Call this method in StartOptimization() and after entering new scales.
itk::ScaledSingleValuedNonLinearOptimizer::ITK_DISALLOW_COPY_AND_MOVE | ( | ScaledSingleValuedNonLinearOptimizer | ) |
|
virtual |
|
virtual |
Setting: set to 'true' if you want to maximize the cost function. It forces the scaledCostFunction to negate the cost function value and its derivative.
|
static |
Method for creation through the object factory.
|
overrideprotected |
PrintSelf.
|
override |
Setting: SetCostFunction.
|
overrideprotected |
Set the scaled current position by entering the non-scaled parameters. The method multiplies param by the scales and calls SetScaledCurrentPosition.
Note: It is not possible (and needed) anymore to set m_CurrentPosition. Optimizers that inherit from this class should optimize the scaled parameters!
This method will probably only be used to convert the InitialPosition entered by the user.
|
virtual |
|
protectedvirtual |
Set m_ScaledCurrentPosition.
|
virtual |
Setting: Turn on/off the use of scales. Set this flag to false when no scaling is desired.
|
private |
Definition at line 191 of file itkScaledSingleValuedNonLinearOptimizer.h.
|
protected |
Definition at line 146 of file itkScaledSingleValuedNonLinearOptimizer.h.
|
protected |
Member variables.
Definition at line 145 of file itkScaledSingleValuedNonLinearOptimizer.h.
|
mutableprivate |
Variable to store the CurrentPosition, when the function GetCurrentPosition is called. This method needs a member variable, because the GetCurrentPosition return something by reference.
Definition at line 190 of file itkScaledSingleValuedNonLinearOptimizer.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |