WolfeConditions

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

The WolfeConditions class specifies conditions for inexact line search algorithms to acceptable/near minimal point along a given search direction p 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 (Weak version, more robust) |f'(x)| <= c2 * |f'(0)| Wolfe condition 2 (Strong version)

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 (vector-to-scalar)

g

the gradient of the objective/loss function (vector-to-vector)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def lsearch(x: VectorD, fx: Double, 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 (alpha) in the search direction p, which satisfies both Wolfe Conditions, returning the displacement a and the new point y = x + p * a.

Perform an inexact Line Search (LS) on the function f to find an approximate local minima from the point x moving distance a (alpha) in the search direction p, which satisfies both Wolfe Conditions, returning the displacement a and the new point y = x + p * a.

Value parameters

fx

the functional value at x, f(x)

p

the current search direction

step

the initial step length

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 weak Wolfe condition 2, the Curvature Condition (CC) is satisfied.

Return whether weak 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

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

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

Return whether strong 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