Wrapper for the linesearch class of functions in the linear algebra library. More...
#include <shark/Algorithms/GradientDescent/LineSearch.h>
Public Types | |
typedef AbstractObjectiveFunction< SearchPointType, double > | ObjectiveFunction |
Public Member Functions | |
LineSearch () | |
LineSearchType | lineSearchType () const |
LineSearchType & | lineSearchType () |
double | minInterval () const |
minInterval sets the minimum initial bracket | |
double & | minInterval () |
minInterval sets the minimum initial bracket | |
double | maxInterval () const |
maxInterval sets the maximum initial bracket | |
double & | maxInterval () |
maxInterval sets the maximum initial bracket | |
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 | |
void | operator() (SearchPointType &searchPoint, double &pointValue, SearchPointType const &newtonDirection, SearchPointType &derivative, double stepLength=1.0) const |
virtual void | read (InArchive &archive) |
Read the component from the supplied archive. | |
virtual void | write (OutArchive &archive) const |
Write the component to the supplied archive. | |
Public Member Functions inherited from shark::ISerializable | |
virtual | ~ISerializable () |
Virtual d'tor. | |
void | load (InArchive &archive, unsigned int version) |
Versioned loading of components, calls read(...). | |
void | save (OutArchive &archive, unsigned int version) const |
Versioned storing of components, calls write(...). | |
BOOST_SERIALIZATION_SPLIT_MEMBER () | |
Protected Attributes | |
double | m_minInterval |
initial [min,max] bracket for linesearch | |
double | m_maxInterval |
initial [min,max] bracket for linesearch | |
LineSearchType | m_lineSearchType |
ObjectiveFunction const * | m_function |
function to optimize | |
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 57 of file LineSearch.h.
typedef AbstractObjectiveFunction<SearchPointType,double> shark::LineSearch< SearchPointType >::ObjectiveFunction |
Definition at line 60 of file LineSearch.h.
|
inline |
Initializes the internal variables of the class to useful default values. Dlinmin is used as default
Definition at line 64 of file LineSearch.h.
References shark::LineSearch< SearchPointType >::m_lineSearchType, shark::LineSearch< SearchPointType >::m_maxInterval, shark::LineSearch< SearchPointType >::m_minInterval, and shark::WolfeCubic.
|
inline |
initializes the internal state of the LineSearch class and sets the function on which the lineSearch is to be evaluated
Definition at line 94 of file LineSearch.h.
References shark::LineSearch< SearchPointType >::m_function.
Referenced by shark::MergeBudgetMaintenanceStrategy< RealVector >::reduceBudget().
|
inline |
Definition at line 73 of file LineSearch.h.
References shark::LineSearch< SearchPointType >::m_lineSearchType.
|
inline |
Definition at line 70 of file LineSearch.h.
References shark::LineSearch< SearchPointType >::m_lineSearchType.
Referenced by shark::MergeBudgetMaintenanceStrategy< RealVector >::reduceBudget().
|
inline |
maxInterval sets the maximum initial bracket
Definition at line 89 of file LineSearch.h.
References shark::LineSearch< SearchPointType >::m_maxInterval.
|
inline |
maxInterval sets the maximum initial bracket
Definition at line 85 of file LineSearch.h.
References shark::LineSearch< SearchPointType >::m_maxInterval.
|
inline |
minInterval sets the minimum initial bracket
Definition at line 81 of file LineSearch.h.
References shark::LineSearch< SearchPointType >::m_minInterval.
|
inline |
minInterval sets the minimum initial bracket
Definition at line 77 of file LineSearch.h.
References shark::LineSearch< SearchPointType >::m_minInterval.
void shark::LineSearch< SearchPointType >::operator() | ( | SearchPointType & | searchPoint, |
double & | pointValue, | ||
SearchPointType const & | newtonDirection, | ||
SearchPointType & | 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 |
|
inlinevirtual |
Read the component from the supplied archive.
[in,out] | archive | The archive to read from. |
Reimplemented from shark::ISerializable.
Definition at line 107 of file LineSearch.h.
References shark::LineSearch< SearchPointType >::m_lineSearchType, shark::LineSearch< SearchPointType >::m_maxInterval, and shark::LineSearch< SearchPointType >::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 113 of file LineSearch.h.
References shark::LineSearch< SearchPointType >::m_lineSearchType, shark::LineSearch< SearchPointType >::m_maxInterval, and shark::LineSearch< SearchPointType >::m_minInterval.
|
protected |
function to optimize
Definition at line 129 of file LineSearch.h.
Referenced by shark::LineSearch< SearchPointType >::init().
|
protected |
Definition at line 126 of file LineSearch.h.
Referenced by shark::LineSearch< SearchPointType >::LineSearch(), shark::LineSearch< SearchPointType >::lineSearchType(), shark::LineSearch< SearchPointType >::lineSearchType(), shark::LineSearch< SearchPointType >::read(), and shark::LineSearch< SearchPointType >::write().
|
protected |
initial [min,max] bracket for linesearch
Definition at line 124 of file LineSearch.h.
Referenced by shark::LineSearch< SearchPointType >::LineSearch(), shark::LineSearch< SearchPointType >::maxInterval(), shark::LineSearch< SearchPointType >::maxInterval(), shark::LineSearch< SearchPointType >::read(), and shark::LineSearch< SearchPointType >::write().
|
protected |
initial [min,max] bracket for linesearch
Definition at line 122 of file LineSearch.h.
Referenced by shark::LineSearch< SearchPointType >::LineSearch(), shark::LineSearch< SearchPointType >::minInterval(), shark::LineSearch< SearchPointType >::minInterval(), shark::LineSearch< SearchPointType >::read(), and shark::LineSearch< SearchPointType >::write().