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, Backtracking } |
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... | |
SHARK_EXPORT_SYMBOL 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... | |
Public Member Functions inherited from shark::ISerializable | |
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 49 of file LineSearch.h.
typedef AbstractObjectiveFunction<RealVector,double> shark::LineSearch::ObjectiveFunction |
Definition at line 56 of file LineSearch.h.
Enumerator | |
---|---|
Dlinmin | |
WolfeCubic | |
Backtracking |
Definition at line 51 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, operator()(), shark::searchPoint(), and SHARK_EXPORT_SYMBOL.
|
inline |
Definition at line 66 of file LineSearch.h.
References m_lineSearchType.
|
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.
SHARK_EXPORT_SYMBOL void shark::LineSearch::operator() | ( | RealVector & | searchPoint, |
double & | pointValue, | ||
RealVector const & | newtonDirection, | ||
RealVector & | derivative, | ||
double | stepLength = 1.0 |
||
) | const |
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 |
Referenced by init().
|
inlinevirtual |
Read the component from the supplied archive.
[in,out] | archive | The archive to read from. |
Reimplemented from shark::ISerializable.
Definition at line 103 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 109 of file LineSearch.h.
References m_lineSearchType, m_maxInterval, and m_minInterval.
|
protected |
|
protected |
Definition at line 122 of file LineSearch.h.
Referenced by LineSearch(), lineSearchType(), read(), and write().
|
protected |
initial [min,max] bracket for linesearch
Definition at line 120 of file LineSearch.h.
Referenced by LineSearch(), maxInterval(), read(), and write().
|
protected |
initial [min,max] bracket for linesearch
Definition at line 118 of file LineSearch.h.
Referenced by LineSearch(), minInterval(), read(), and write().