ITK
5.2.0
Insight Toolkit
|
#include <itkPowellOptimizer.h>
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
virtual const char * | GetNameOfClass () const |
Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer | |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
virtual const CostFunctionType * | GetCostFunction () const |
virtual CostFunctionType * | GetModifiableCostFunction () |
MeasureType | GetValue (const ParametersType ¶meters) const |
virtual void | SetCostFunction (CostFunctionType *costFunction) |
Public Member Functions inherited from itk::Optimizer | |
virtual const ParametersType & | GetInitialPosition () const |
virtual void | SetInitialPosition (const ParametersType ¶m) |
void | SetScales (const ScalesType &scales) |
virtual const ScalesType & | GetScales () const |
virtual const ScalesType & | GetInverseScales () const |
virtual const ParametersType & | GetCurrentPosition () const |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *) |
unsigned long | AddObserver (const EventObject &event, Command *) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () 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 |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
Pointer | Clone () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer | |
static Pointer | New () |
Static Public Member Functions inherited from itk::NonLinearOptimizer | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Optimizer | |
static Pointer | New () |
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 () |
unsigned int | m_SpaceDimension |
unsigned int | m_CurrentIteration |
unsigned int | m_CurrentLineIteration |
unsigned int | m_MaximumIteration |
unsigned int | m_MaximumLineIteration |
bool | m_CatchGetValueException |
double | m_MetricWorstPossibleValue |
bool | m_Maximize |
double | m_StepLength |
double | m_StepTolerance |
ParametersType | m_LineOrigin |
vnl_vector< double > | m_LineDirection |
double | m_ValueTolerance |
MeasureType | m_CurrentCost |
bool | m_Stop |
std::ostringstream | m_StopConditionDescription |
virtual void | SetMaximize (bool _arg) |
virtual void | MaximizeOn () |
virtual void | MaximizeOff () |
virtual const bool & | GetMaximize () const |
virtual void | SetMaximumIteration (unsigned int _arg) |
virtual const unsigned int & | GetMaximumIteration () const |
virtual void | SetMaximumLineIteration (unsigned int _arg) |
virtual unsigned int | GetMaximumLineIteration () const |
virtual void | SetStepLength (double _arg) |
virtual const double & | GetStepLength () const |
virtual void | SetStepTolerance (double _arg) |
virtual const double & | GetStepTolerance () const |
virtual void | SetValueTolerance (double _arg) |
virtual const double & | GetValueTolerance () const |
virtual const MeasureType & | GetCurrentCost () const |
MeasureType | GetValue () const |
virtual const unsigned int & | GetCurrentIteration () const |
virtual const unsigned int & | GetCurrentLineIteration () const |
void | StartOptimization () override |
void | StopOptimization () |
virtual const bool & | GetCatchGetValueException () const |
virtual void | SetCatchGetValueException (bool _arg) |
virtual const double & | GetMetricWorstPossibleValue () const |
virtual void | SetMetricWorstPossibleValue (double _arg) |
const std::string | GetStopConditionDescription () const override |
PowellOptimizer () | |
PowellOptimizer (const PowellOptimizer &) | |
~PowellOptimizer () override | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
virtual void | SetCurrentCost (double _arg) |
void | SetLine (const ParametersType &origin, const vnl_vector< double > &direction) |
double | GetLineValue (double x) const |
double | GetLineValue (double x, ParametersType &tempCoord) const |
void | SetCurrentLinePoint (double x, double fx) |
void | Swap (double *a, double *b) const |
void | Shift (double *a, double *b, double *c, double d) const |
virtual void | LineBracket (double *x1, double *x2, double *x3, double *f1, double *f2, double *f3) |
virtual void | LineBracket (double *x1, double *x2, double *x3, double *f1, double *f2, double *f3, ParametersType &tempCoord) |
virtual void | BracketedLineOptimize (double ax, double bx, double cx, double fa, double functionValueOfb, double fc, double *extX, double *extVal) |
virtual void | BracketedLineOptimize (double ax, double bx, double cx, double fa, double functionValueOfb, double fc, double *extX, double *extVal, ParametersType &tempCoord) |
virtual unsigned int | GetSpaceDimension () |
void | SetSpaceDimension (unsigned int dim) |
virtual void | SetCurrentIteration (unsigned int _arg) |
virtual bool | GetStop () |
virtual void | SetStop (bool _arg) |
Additional Inherited Members | |
Protected Member Functions inherited from itk::SingleValuedNonLinearOptimizer | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
SingleValuedNonLinearOptimizer () | |
~SingleValuedNonLinearOptimizer () override=default | |
Protected Member Functions inherited from itk::NonLinearOptimizer | |
NonLinearOptimizer ()=default | |
~NonLinearOptimizer () override | |
Protected Member Functions inherited from itk::Optimizer | |
Optimizer () | |
~Optimizer () override=default | |
virtual void | SetCurrentPosition (const ParametersType ¶m) |
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::SingleValuedNonLinearOptimizer | |
CostFunctionPointer | m_CostFunction |
Protected Attributes inherited from itk::Optimizer | |
bool | m_ScalesInitialized { false } |
ParametersType | m_CurrentPosition |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount |
Implements Powell optimization using Brent line search.
The code in this class was adapted from the Wikipedia and the netlib.org zeroin function.
http://www.netlib.org/go/zeroin.f http://en.wikipedia.org/wiki/Brent_method http://en.wikipedia.org/wiki/Golden_section_search
This optimizer needs a cost function. Partial derivatives of that function are not required.
For an N-dimensional parameter space, each iteration minimizes(maximizes) the function in N (initially orthogonal) directions. Typically only 2-5 iterations are required. If gradients are available, consider a conjugate gradient line search strategy.
The SetStepLength determines the initial distance to step in a line direction when bounding the minimum (using bracketing triple spaced using a golden search strategy).
The StepTolerance terminates optimization when the parameter values are known to be within this (scaled) distance of the local extreme.
The ValueTolerance terminates optimization when the cost function values at the current parameters and at the local extreme are likely (within a second order approximation) to be within this is tolerance.
Definition at line 62 of file itkPowellOptimizer.h.
using itk::PowellOptimizer::ConstPointer = SmartPointer<const Self> |
Definition at line 69 of file itkPowellOptimizer.h.
Definition at line 81 of file itkPowellOptimizer.h.
Type of the Cost Function
Definition at line 80 of file itkPowellOptimizer.h.
Definition at line 71 of file itkPowellOptimizer.h.
Definition at line 68 of file itkPowellOptimizer.h.
Standard "Self" type alias.
Definition at line 66 of file itkPowellOptimizer.h.
Definition at line 67 of file itkPowellOptimizer.h.
|
protected |
Current iteration
|
protected |
Current iteration
|
overrideprotected |
Current iteration
|
protectedvirtual |
Given a bracketing triple of points and their function values, returns a bounded extreme. These values are in parameter space, along the current line and wrt the current origin set via SetLine. Optimization terminates based on MaximumIteration, StepTolerance, or ValueTolerance. Implemented as Brent line optimizers from NRC.
|
protectedvirtual |
Current iteration
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::NonLinearOptimizer.
|
virtual |
Current iteration
|
virtual |
Return Current Value
|
virtual |
Return Current Iteration
|
virtual |
Get the current line search iteration
|
protected |
Get the value of the n-dimensional cost function at this scalar step distance along the current line direction from the current line origin. Line origin and distances are set via SetLine
|
protected |
Current iteration
|
virtual |
Current iteration
|
virtual |
Current iteration
|
virtual |
Current iteration
|
virtual |
Current iteration
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::SingleValuedNonLinearOptimizer.
Reimplemented in itk::FRPROptimizer.
|
protectedvirtual |
Current iteration
|
virtual |
Current iteration
|
virtual |
Current iteration
|
protectedvirtual |
Current iteration
|
overridevirtual |
Current iteration
Reimplemented from itk::Optimizer.
|
inline |
Current iteration
Definition at line 121 of file itkPowellOptimizer.h.
|
virtual |
Current iteration
|
protectedvirtual |
The LineBracket routine from NRC. Later reimplemented from the description of the method available in the Wikipedia.
Uses current origin and line direction (from SetLine) to find a triple of points (ax, bx, cx) that bracket the extreme "near" the origin. Search first considers the point StepLength distance from ax.
IMPORTANT: The value of ax and the value of the function at ax (i.e., fa), must both be provided to this function.
|
protectedvirtual |
Current iteration
|
virtual |
Current iteration
|
virtual |
Current iteration
|
static |
Method for creation through the object factory.
|
overrideprotectedvirtual |
Current iteration
Reimplemented from itk::Optimizer.
|
virtual |
Current iteration
|
protectedvirtual |
Current iteration
|
protectedvirtual |
Current iteration
|
protected |
Set the given scalar step distance (x) and function value (fx) as the "best-so-far" optimizer values.
|
protected |
Used to specify the line direction through the n-dimensional parameter space the is currently being bracketed and optimized.
|
virtual |
Set if the Optimizer should Maximize the metric
|
virtual |
Set/Get maximum iteration limit.
|
virtual |
Set/Get the maximum number of line search iterations
|
virtual |
Current iteration
|
inlineprotected |
Current iteration
Definition at line 236 of file itkPowellOptimizer.h.
|
virtual |
Set/Get StepLength for the (scaled) spacing of the sampling of parameter space while bracketing the extremum
|
virtual |
Set/Get StepTolerance. Once the local extreme is known to be within this distance of the current parameter values, optimization terminates
|
protectedvirtual |
Current iteration
|
virtual |
Set/Get ValueTolerance. Once this current cost function value is known to be within this tolerance of the cost function value at the local extreme, optimization terminates
|
protected |
Used in bracketing the extreme along the current line. Adapted from NRC
|
overridevirtual |
Start optimization.
Reimplemented from itk::Optimizer.
|
inline |
When users call StartOptimization, this value will be set false. By calling StopOptimization, this flag will be set true, and optimization will stop at the next iteration.
Definition at line 141 of file itkPowellOptimizer.h.
|
protected |
Used in bracketing the extreme along the current line. Adapted from NRC
|
private |
Current iteration
Definition at line 261 of file itkPowellOptimizer.h.
|
private |
Internal storage for the value type / used as a cache
Definition at line 277 of file itkPowellOptimizer.h.
|
private |
Current iteration
Definition at line 254 of file itkPowellOptimizer.h.
|
private |
Current iteration
Definition at line 255 of file itkPowellOptimizer.h.
|
private |
Current iteration
Definition at line 272 of file itkPowellOptimizer.h.
|
private |
Current iteration
Definition at line 271 of file itkPowellOptimizer.h.
|
private |
Set if the Metric should be maximized: Default = False
Definition at line 265 of file itkPowellOptimizer.h.
|
private |
Maximum iteration limit.
Definition at line 258 of file itkPowellOptimizer.h.
|
private |
Current iteration
Definition at line 259 of file itkPowellOptimizer.h.
|
private |
Current iteration
Definition at line 262 of file itkPowellOptimizer.h.
|
private |
Current iteration
Definition at line 248 of file itkPowellOptimizer.h.
|
private |
The minimal size of search
Definition at line 268 of file itkPowellOptimizer.h.
|
private |
Current iteration
Definition at line 269 of file itkPowellOptimizer.h.
|
private |
this is user-settable flag to stop optimization. when users call StartOptimization, this value will be set false. By calling StopOptimization, this flag will be set true, and optimization will stop at the next iteration.
Definition at line 283 of file itkPowellOptimizer.h.
|
private |
Current iteration
Definition at line 285 of file itkPowellOptimizer.h.
|
private |
Current iteration
Definition at line 274 of file itkPowellOptimizer.h.