WolfeLS2

scalation.optimization.WolfeLS2
class WolfeLS2(f: FunctionV2S, var g: FunctionV2V, c1: Double, c2: Double)

The WolfeLS2 class performs an inexact line search on f to find (1) a point x that exhibits (1) SDC: sufficient decrease (f(x) enough less that f(0)) and (2) CC: the slope at x is less steep than the slope at 0. That is, the line search looks for a value for x satisfying the two Wolfe conditions.

f(x) <= f(0) + c1 * f'(0) * x Wolfe condition 1 (Armijo condition) |f'(x)| <= |c2 * f'(0)| Wolfe condition 2 (Strong version) f'(x) >= c2 * f'(0) Wolfe condition 2 (Weak version, more robust)

The it uses bisection (or interpolative search) to find an approximate local minimal point. Currently, the strong version is not supported. Note: c1 and c2 defaults below intended for Quasi Newton methods such as BFGS or L-BFGS

Value parameters

c1

constant for sufficient decrease (Wolfe condition 1: .0001 to .001)

c2

constant for curvature/slope constraint (Wolfe condition 2: .9 to .8)

f

the objective/loss function to minimize

g

the gradient of the objective/loss function

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def lsearch(x: VectorD, p: VectorD, step: Double): (Double, VectorD)

Perform an inexact Line Search (LS) on the function f to find an approximate local minima from the point x moving distance a in the search direction p in two steps: (1) The START point is x (at a = 0), while the END point x_max (at a = a_max) is a distant point that satisfies the Wolfe Conditions 1 and 2. Begin with a = 1 and decrease it (e.g., * 0.5) until both conditions are satisfied to get a_max. (2) Perform bisection (or interpolative) search over the interval for a = (0, a_max) and return its solutions.

Perform an inexact Line Search (LS) on the function f to find an approximate local minima from the point x moving distance a in the search direction p in two steps: (1) The START point is x (at a = 0), while the END point x_max (at a = a_max) is a distant point that satisfies the Wolfe Conditions 1 and 2. Begin with a = 1 and decrease it (e.g., * 0.5) until both conditions are satisfied to get a_max. (2) Perform bisection (or interpolative) search over the interval for a = (0, a_max) and return its solutions.

Value parameters

p

the current search direction

x

the current point

Attributes

inline def wolfe1(fx: Double, fy: Double, a: Double, gxp: Double): Boolean

Return whether Wolfe condition 1, the Sufficient Decrease Condition (SDC) is satisfied.

Return whether Wolfe condition 1, the Sufficient Decrease Condition (SDC) is satisfied.

Value parameters

a

the displacement in the search direction

fx

the functional value of the original point

fy

the functional value of the new point y = x + p * a

gxp

the dot product of the gradient vector g(x) and the search vector p

Attributes

inline def wolfe2(p: VectorD, gy: VectorD, gxp: Double): Boolean

Return whether Wolfe condition 2, the Curvature Condition (CC) is satisfied.

Return whether Wolfe condition 2, the Curvature Condition (CC) is satisfied.

Value parameters

gxp

the dot product of the gradient vector g(x) and the search vector p

gy

the gradient at new point y = x + p * a

p

the search direction vector

Attributes

Concrete fields

var g: FunctionV2V