Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
#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 | |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::CostFunctionType | CostFunctionType |
typedef Superclass::DerivativeType | DerivativeType |
typedef Superclass::MeasureType | MeasureType |
typedef Superclass::ParametersType | ParametersType |
typedef SmartPointer< Self > | Pointer |
typedef ScaledCostFunctionType::Pointer | ScaledCostFunctionPointer |
typedef ScaledSingleValuedCostFunction | ScaledCostFunctionType |
typedef NonLinearOptimizer::ScalesType | ScalesType |
typedef ScaledSingleValuedNonLinearOptimizer | Self |
typedef SingleValuedNonLinearOptimizer | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () const |
const ParametersType & | GetCurrentPosition (void) const override |
virtual bool | GetMaximize () const |
virtual const ScaledCostFunctionType * | GetScaledCostFunction () |
virtual const ParametersType & | GetScaledCurrentPosition () |
bool | GetUseScales (void) const |
virtual void | InitializeScales (void) |
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 | |
Protected Attributes | |
ScaledCostFunctionPointer | m_ScaledCostFunction |
ParametersType | m_ScaledCurrentPosition |
Private Member Functions | |
void | operator= (const Self &) |
ScaledSingleValuedNonLinearOptimizer (const Self &) | |
Private Attributes | |
bool | m_Maximize |
ParametersType | m_UnscaledCurrentPosition |
typedef SmartPointer< const Self > itk::ScaledSingleValuedNonLinearOptimizer::ConstPointer |
Definition at line 71 of file itkScaledSingleValuedNonLinearOptimizer.h.
typedef Superclass::CostFunctionType itk::ScaledSingleValuedNonLinearOptimizer::CostFunctionType |
Definition at line 84 of file itkScaledSingleValuedNonLinearOptimizer.h.
typedef Superclass::DerivativeType itk::ScaledSingleValuedNonLinearOptimizer::DerivativeType |
Definition at line 83 of file itkScaledSingleValuedNonLinearOptimizer.h.
typedef Superclass::MeasureType itk::ScaledSingleValuedNonLinearOptimizer::MeasureType |
Typedefs inherited from the superclass.
Definition at line 81 of file itkScaledSingleValuedNonLinearOptimizer.h.
typedef Superclass::ParametersType itk::ScaledSingleValuedNonLinearOptimizer::ParametersType |
Definition at line 82 of file itkScaledSingleValuedNonLinearOptimizer.h.
typedef SmartPointer< Self > itk::ScaledSingleValuedNonLinearOptimizer::Pointer |
Definition at line 70 of file itkScaledSingleValuedNonLinearOptimizer.h.
typedef ScaledCostFunctionType::Pointer itk::ScaledSingleValuedNonLinearOptimizer::ScaledCostFunctionPointer |
Definition at line 88 of file itkScaledSingleValuedNonLinearOptimizer.h.
typedef ScaledSingleValuedCostFunction itk::ScaledSingleValuedNonLinearOptimizer::ScaledCostFunctionType |
Definition at line 87 of file itkScaledSingleValuedNonLinearOptimizer.h.
typedef NonLinearOptimizer::ScalesType itk::ScaledSingleValuedNonLinearOptimizer::ScalesType |
Definition at line 86 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.
|
inlineoverrideprotected |
The destructor.
Definition at line 134 of file itkScaledSingleValuedNonLinearOptimizer.h.
|
private |
The private constructor.
|
virtual |
Run-time type information (and related methods).
Reimplemented in itk::ComputeDisplacementDistribution< TFixedImage, TTransform >, itk::ComputePreconditionerUsingDisplacementDistribution< TFixedImage, TTransform >, elastix::AdaGrad< TElastix >, itk::AdaptiveStepsizeOptimizer, elastix::AdaptiveStochasticGradientDescent< TElastix >, itk::AdaptiveStochasticGradientDescentOptimizer, elastix::AdaptiveStochasticLBFGS< TElastix >, itk::AdaptiveStochasticLBFGSOptimizer, elastix::AdaptiveStochasticVarianceReducedGradient< TElastix >, itk::AdaptiveStochasticVarianceReducedGradientOptimizer, itk::StandardStochasticVarianceReducedGradientOptimizer, itk::StochasticVarianceReducedGradientDescentOptimizer, elastix::CMAEvolutionStrategy< TElastix >, itk::CMAEvolutionStrategyOptimizer, elastix::ConjugateGradient< TElastix >, itk::GenericConjugateGradientOptimizer, elastix::FiniteDifferenceGradientDescent< TElastix >, itk::FiniteDifferenceGradientDescentOptimizer, elastix::PreconditionedGradientDescent< TElastix >, itk::AdaptiveStochasticPreconditionedGradientDescentOptimizer, itk::PreconditionedGradientDescentOptimizer, itk::StochasticPreconditionedGradientDescentOptimizer, elastix::PreconditionedStochasticGradientDescent< TElastix >, itk::PreconditionedASGDOptimizer, elastix::QuasiNewtonLBFGS< TElastix >, itk::QuasiNewtonLBFGSOptimizer, elastix::StandardGradientDescent< TElastix >, itk::GradientDescentOptimizer2, itk::StandardGradientDescentOptimizer, itk::StandardStochasticGradientOptimizer, and itk::StochasticGradientDescentOptimizer.
|
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 | ( | void | ) | 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.
|
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.
|
private |
The private copy constructor.
|
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 141 of file itkScaledSingleValuedNonLinearOptimizer.h.
|
protected |
Member variables.
Definition at line 140 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 1667476801 for elastix by 1.9.4 |