|
primatologist-gpl 6.0.4
|
Once an ascent direction is given, this class performs a line search that respects wolfe conditions. More...
#include <primatologist/optimization/wolfe_decl.h>

Public Types | |
| typedef O | Objective |
| typedef math::Matrix | Matrix |
| typedef math::Vector | Vector |
Public Member Functions | |
| WolfeLineSearch (const Objective &f=Objective(), const Vector &x=Vector(), const Vector &p=Vector()) | |
| WolfeLineSearch (const WolfeLineSearch< O > &other) | |
| ~WolfeLineSearch () | |
| WolfeLineSearch< O > & | operator= (const WolfeLineSearch< O > &other) |
| void | setC1 (float c1=1E-4) |
| void | setC2 (float c2=0.9) |
| void | setStrongWolfe (bool strong=false) |
| void | setMaximize (bool maximize=false) |
| void | setMaxIterations (int n=- 1) |
| void | setVerbose (int v=carto::verbose) |
| void | setObjectiveFunction (const Objective &f) |
| void | setPosition (const Vector &x=Vector()) |
| void | setSearchDirection (const Vector &p=Vector()) |
| float | c1 () const |
| float | c2 () const |
| bool | strongWolfe () const |
| bool | maximize () const |
| int | maxIterations () const |
| int | verbose () const |
| const Objective & | objectiveFunction () const |
| const Vector & | position () const |
| const Vector & | searchDirection () const |
| Vector | execute () |
Protected Member Functions | |
| bool | wolfe1 (float a) const |
| Armijo (= Wolfe 1st) condition. | |
| bool | wolfe2w (float a) const |
| weak 2nd Wolfe condition | |
| bool | wolfe2s (float a) const |
| strong 2nd Wolfe condition | |
| bool | wolfe2 (float a) const |
| select condition based on _strong | |
| bool | checkDirection () |
| Compute f(x) and <p, g(x)>. | |
Protected Attributes | |
| float | _c1 |
| Wolfe c1. | |
| float | _c2 |
| Wolfe c2. | |
| Vector | _x |
| position | |
| Vector | _p |
| ascentDirection | |
| Objective | _f |
| objectiveFunction | |
| bool | _strong |
| strongWolfe | |
| int | _verbose |
| verbosity level | |
| bool | _maximize |
| maximize or minimize | |
| int | _max_it |
| maximum number of iterations | |
| float | _previous_value |
| f(x) | |
| float | _current_value |
| f(x + a.p) | |
| float | _previous_scalarprod |
| <p, g(x)> | |
Once an ascent direction is given, this class performs a line search that respects wolfe conditions.
Wolfe conditions depend on two parameters 0 < c1 < c2 < 1 and hold if: 1) f( x + a.p ) >= f(x) + c1.a.p * g( x ) , 2a) p * g( x + a.p ) >= c2.p * g( x ) , where x is the previous parameter value of the objective function, p is the provided search direction, f returns the value of the objective function, g returns its gradient and a is the step length optimzed by this line search. For strong wolfe condition, inequality 2a is replaced by inequality 2b: 2b) |p * g( x + a.p )| <= c2.|p * g( x )| .
| Model | An objective function class that implements value( Vector ) and derivative( Vector ) |
Definition at line 38 of file wolfe_decl.h.
| typedef math::Matrix aims::WolfeLineSearch< O >::Matrix |
Definition at line 45 of file wolfe_decl.h.
| typedef O aims::WolfeLineSearch< O >::Objective |
Definition at line 44 of file wolfe_decl.h.
| typedef math::Vector aims::WolfeLineSearch< O >::Vector |
Definition at line 46 of file wolfe_decl.h.
| aims::WolfeLineSearch< O >::WolfeLineSearch | ( | const Objective & | f = Objective(), |
| const Vector & | x = Vector(), | ||
| const Vector & | p = Vector() ) |
Definition at line 27 of file wolfe_d.h.
References _f, _p, _x, setC1(), setC2(), setMaximize(), setMaxIterations(), setStrongWolfe(), and setVerbose().
Referenced by operator=(), and WolfeLineSearch().
| aims::WolfeLineSearch< O >::WolfeLineSearch | ( | const WolfeLineSearch< O > & | other | ) |
Definition at line 43 of file wolfe_d.h.
References _c1, _c2, _current_value, _f, _max_it, _maximize, _p, _previous_scalarprod, _previous_value, _strong, _verbose, _x, and WolfeLineSearch().
| aims::WolfeLineSearch< O >::~WolfeLineSearch | ( | ) |
| float aims::WolfeLineSearch< O >::c1 | ( | ) | const |
| float aims::WolfeLineSearch< O >::c2 | ( | ) | const |
|
protected |
Compute f(x) and <p, g(x)>.
Check that the search direction has the right orientation.
Definition at line 317 of file wolfe_d.h.
References _p, _previous_scalarprod, _previous_value, _x, maximize(), objectiveFunction(), and aims::math::transpose().
Referenced by execute().
| WolfeLineSearch< O >::Vector aims::WolfeLineSearch< O >::execute | ( | ) |
Definition at line 208 of file wolfe_d.h.
References _current_value, _p, _previous_value, _x, checkDirection(), maximize(), maxIterations(), objectiveFunction(), verbose(), wolfe1(), and wolfe2().
| bool aims::WolfeLineSearch< O >::maximize | ( | ) | const |
Definition at line 191 of file wolfe_d.h.
References _maximize.
Referenced by checkDirection(), execute(), setMaximize(), wolfe1(), and wolfe2w().
| int aims::WolfeLineSearch< O >::maxIterations | ( | ) | const |
| const WolfeLineSearch< O >::Objective & aims::WolfeLineSearch< O >::objectiveFunction | ( | ) | const |
| WolfeLineSearch< O > & aims::WolfeLineSearch< O >::operator= | ( | const WolfeLineSearch< O > & | other | ) |
Definition at line 64 of file wolfe_d.h.
References _c1, _c2, _current_value, _f, _max_it, _maximize, _p, _previous_scalarprod, _previous_value, _strong, _verbose, _x, and WolfeLineSearch().
| const WolfeLineSearch< O >::Vector & aims::WolfeLineSearch< O >::position | ( | ) | const |
| const WolfeLineSearch< O >::Vector & aims::WolfeLineSearch< O >::searchDirection | ( | ) | const |
| void aims::WolfeLineSearch< O >::setC1 | ( | float | c1 = 1E-4 | ) |
| void aims::WolfeLineSearch< O >::setC2 | ( | float | c2 = 0.9 | ) |
| void aims::WolfeLineSearch< O >::setMaximize | ( | bool | maximize = false | ) |
Definition at line 130 of file wolfe_d.h.
References _maximize, and maximize().
Referenced by WolfeLineSearch().
| void aims::WolfeLineSearch< O >::setMaxIterations | ( | int | n = - 1 | ) |
| void aims::WolfeLineSearch< O >::setObjectiveFunction | ( | const Objective & | f | ) |
| void aims::WolfeLineSearch< O >::setPosition | ( | const Vector & | x = Vector() | ) |
| void aims::WolfeLineSearch< O >::setSearchDirection | ( | const Vector & | p = Vector() | ) |
| void aims::WolfeLineSearch< O >::setStrongWolfe | ( | bool | strong = false | ) |
| void aims::WolfeLineSearch< O >::setVerbose | ( | int | v = carto::verbose | ) |
| bool aims::WolfeLineSearch< O >::strongWolfe | ( | ) | const |
| int aims::WolfeLineSearch< O >::verbose | ( | ) | const |
|
protected |
Armijo (= Wolfe 1st) condition.
Definition at line 328 of file wolfe_d.h.
References _c1, _current_value, _previous_scalarprod, _previous_value, and maximize().
Referenced by execute().
|
protected |
|
protected |
strong 2nd Wolfe condition
Definition at line 349 of file wolfe_d.h.
References _c2, _p, _previous_scalarprod, _x, objectiveFunction(), and aims::math::transpose().
Referenced by wolfe2().
|
protected |
weak 2nd Wolfe condition
Definition at line 338 of file wolfe_d.h.
References _c2, _p, _previous_scalarprod, _x, maximize(), objectiveFunction(), and aims::math::transpose().
Referenced by wolfe2().
|
protected |
Wolfe c1.
Definition at line 101 of file wolfe_decl.h.
Referenced by c1(), operator=(), setC1(), wolfe1(), and WolfeLineSearch().
|
protected |
Wolfe c2.
Definition at line 102 of file wolfe_decl.h.
Referenced by c2(), operator=(), setC2(), wolfe2s(), wolfe2w(), and WolfeLineSearch().
|
protected |
f(x + a.p)
Definition at line 121 of file wolfe_decl.h.
Referenced by execute(), operator=(), wolfe1(), and WolfeLineSearch().
|
protected |
objectiveFunction
Definition at line 105 of file wolfe_decl.h.
Referenced by objectiveFunction(), operator=(), setObjectiveFunction(), WolfeLineSearch(), and WolfeLineSearch().
|
protected |
maximum number of iterations
Definition at line 109 of file wolfe_decl.h.
Referenced by maxIterations(), operator=(), setMaxIterations(), and WolfeLineSearch().
|
protected |
maximize or minimize
Definition at line 108 of file wolfe_decl.h.
Referenced by maximize(), operator=(), setMaximize(), and WolfeLineSearch().
|
protected |
ascentDirection
Definition at line 104 of file wolfe_decl.h.
Referenced by checkDirection(), execute(), operator=(), searchDirection(), setSearchDirection(), wolfe2s(), wolfe2w(), WolfeLineSearch(), and WolfeLineSearch().
|
protected |
<p, g(x)>
Definition at line 122 of file wolfe_decl.h.
Referenced by checkDirection(), operator=(), wolfe1(), wolfe2s(), wolfe2w(), and WolfeLineSearch().
|
protected |
f(x)
Definition at line 120 of file wolfe_decl.h.
Referenced by checkDirection(), execute(), operator=(), wolfe1(), and WolfeLineSearch().
|
protected |
strongWolfe
Definition at line 106 of file wolfe_decl.h.
Referenced by operator=(), setStrongWolfe(), strongWolfe(), wolfe2(), and WolfeLineSearch().
|
protected |
verbosity level
Definition at line 107 of file wolfe_decl.h.
Referenced by operator=(), setVerbose(), verbose(), and WolfeLineSearch().
|
protected |
position
Definition at line 103 of file wolfe_decl.h.
Referenced by checkDirection(), execute(), operator=(), position(), setPosition(), wolfe2s(), wolfe2w(), WolfeLineSearch(), and WolfeLineSearch().