20 #ifndef MIRTK_GradientDescent_H 21 #define MIRTK_GradientDescent_H 23 #include "mirtk/LocalOptimizer.h" 24 #include "mirtk/LineSearch.h" 25 #include "mirtk/EventDelegate.h" 43 mirtkPublicAttributeMacro(
int, NumberOfRestarts);
46 mirtkPublicAttributeMacro(
int, NumberOfFailedRestarts);
58 mirtkAttributeMacro(
bool, LineSearchOwner);
95 using LocalOptimizer::Function;
108 virtual bool Set(
const char *,
const char *);
125 virtual double Run();
130 virtual void Gradient(
double *,
double = .0,
bool * = NULL);
140 #endif // MIRTK_GradientDescent_H
virtual void Gradient(double *, double=.0, bool *=NULL)
Compute descent direction.
virtual ParameterList Parameter() const
Get parameters as key/value as string map.
GradientDescent(ObjectiveFunction *=NULL)
Constructor.
virtual void Initialize()
virtual ~GradientDescent()
Destructor.
Array< Pair< string, string > > ParameterList
Ordered list of parameter name/value pairs.
virtual ParameterList Parameter() const
Get parameters as key/value as string map.
virtual bool Set(const char *, const char *)
Set parameter value from string.
virtual void Function(ObjectiveFunction *)
Set objective function.
virtual void LineSearch(class LineSearch *, bool=false)
Set line search object.
double * _Gradient
Allocated memory for line search direction.
GradientDescent & operator=(const GradientDescent &)
Assignment operator.
virtual void Finalize()
Finalize gradient descent.
LineSearchStrategy
Enumeration of available line search strategies.
virtual double Run()
Optimize objective function using gradient descent.