Wrapper for the linesearch class of functions in the linear algebra library. More...
#include <shark/Algorithms/GradientDescent/LineSearch.h>
Public Types | |
enum | LineSearchType { Dlinmin, WolfeCubic } |
typedef AbstractObjectiveFunction< RealVector, double > | ObjectiveFunction |
Public Member Functions | |
LineSearch () | |
LineSearchType | lineSearchType () const |
LineSearchType & | lineSearchType () |
double | minInterval () const |
minInterval sets the minimum initial bracket More... | |
double & | minInterval () |
minInterval sets the minimum initial bracket More... | |
double | maxInterval () const |
maxInterval sets the maximum initial bracket More... | |
double & | maxInterval () |
maxInterval sets the maximum initial bracket More... | |
void | init (ObjectiveFunction const &objectiveFunction) |
initializes the internal state of the LineSearch class and sets the function on which the lineSearch is to be evaluated More... | |
virtual void | operator() (RealVector &searchPoint, double &pointValue, RealVector const &newtonDirection, RealVector &derivative, double stepLength=1.0) const |
virtual void | read (InArchive &archive) |
Read the component from the supplied archive. More... | |
virtual void | write (OutArchive &archive) const |
Write the component to the supplied archive. More... | |
![]() | |
virtual | ~ISerializable () |
Virtual d'tor. More... | |
void | load (InArchive &archive, unsigned int version) |
Versioned loading of components, calls read(...). More... | |
void | save (OutArchive &archive, unsigned int version) const |
Versioned storing of components, calls write(...). More... | |
BOOST_SERIALIZATION_SPLIT_MEMBER () | |
Protected Attributes | |
double | m_minInterval |
initial [min,max] bracket for linesearch More... | |
double | m_maxInterval |
initial [min,max] bracket for linesearch More... | |
LineSearchType | m_lineSearchType |
ObjectiveFunction const * | m_function |
function to optimize More... | |
Wrapper for the linesearch class of functions in the linear algebra library.
This class is a wrapper for the linesearch class of functions of the linear algebra library. The class is used for example in CG or BFGS for their internal linesearch learning steps. It is NOT an Optimizer on its own, since it needs the Newton direction to be specified.
Definition at line 50 of file LineSearch.h.
typedef AbstractObjectiveFunction<RealVector,double> shark::LineSearch::ObjectiveFunction |
Definition at line 56 of file LineSearch.h.
Enumerator | |
---|---|
Dlinmin | |
WolfeCubic |
Definition at line 52 of file LineSearch.h.
|
inline |
Initializes the internal variables of the class to useful default values. Dlinmin is used as default
Definition at line 60 of file LineSearch.h.
References Dlinmin, m_lineSearchType, m_maxInterval, and m_minInterval.
|
inline |
initializes the internal state of the LineSearch class and sets the function on which the lineSearch is to be evaluated
Definition at line 90 of file LineSearch.h.
References m_function.
|
inline |
|
inline |
Definition at line 69 of file LineSearch.h.
References m_lineSearchType.
|
inline |
maxInterval sets the maximum initial bracket
Definition at line 81 of file LineSearch.h.
References m_maxInterval.
|
inline |
maxInterval sets the maximum initial bracket
Definition at line 85 of file LineSearch.h.
References m_maxInterval.
|
inline |
minInterval sets the minimum initial bracket
Definition at line 73 of file LineSearch.h.
References m_minInterval.
|
inline |
minInterval sets the minimum initial bracket
Definition at line 77 of file LineSearch.h.
References m_minInterval.
|
inlinevirtual |
performs a linesearch on the objectiveFunction given the starting point, its value the newton direction and optionally the derivative at the starting point
searchPoint | the point where the linesearch start |
pointValue | the value of the function at searchPoint |
newtonDirection | the search direction of the line search |
derivative | the derivative of the function at searchPoint |
stepLength | initial step length guess for guiding the line search |
Definition at line 100 of file LineSearch.h.
References Dlinmin, shark::AbstractObjectiveFunction< PointType, ResultT >::evalDerivative(), m_function, m_lineSearchType, m_maxInterval, m_minInterval, and WolfeCubic.
|
inlinevirtual |
Read the component from the supplied archive.
[in,out] | archive | The archive to read from. |
Reimplemented from shark::ISerializable.
Definition at line 113 of file LineSearch.h.
References m_lineSearchType, m_maxInterval, and m_minInterval.
|
inlinevirtual |
Write the component to the supplied archive.
[in,out] | archive | The archive to write to. |
Reimplemented from shark::ISerializable.
Definition at line 119 of file LineSearch.h.
References m_lineSearchType, m_maxInterval, and m_minInterval.
|
protected |
function to optimize
Definition at line 135 of file LineSearch.h.
Referenced by init(), and operator()().
|
protected |
Definition at line 132 of file LineSearch.h.
Referenced by LineSearch(), lineSearchType(), operator()(), read(), and write().
|
protected |
initial [min,max] bracket for linesearch
Definition at line 130 of file LineSearch.h.
Referenced by LineSearch(), maxInterval(), operator()(), read(), and write().
|
protected |
initial [min,max] bracket for linesearch
Definition at line 128 of file LineSearch.h.
Referenced by LineSearch(), minInterval(), operator()(), read(), and write().