scipy.optimize.line_search¶
- scipy.optimize.line_search(f, myfprime, xk, pk, gfk=None, old_fval=None, old_old_fval=None, args=(), c1=0.0001, c2=0.9, amax=50)[source]¶
Find alpha that satisfies strong Wolfe conditions.
Parameters: f : callable f(x,*args)
Objective function.
myfprime : callable f’(x,*args)
Objective function gradient.
xk : ndarray
Starting point.
pk : ndarray
Search direction.
gfk : ndarray, optional
Gradient value for x=xk (xk being the current parameter estimate). Will be recomputed if omitted.
old_fval : float, optional
Function value for x=xk. Will be recomputed if omitted.
old_old_fval : float, optional
Function value for the point preceding x=xk
args : tuple, optional
Additional arguments passed to objective function.
c1 : float, optional
Parameter for Armijo condition rule.
c2 : float, optional
Parameter for curvature condition rule.
Returns: alpha : float
Alpha for which x_new = x0 + alpha * pk.
fc : int
Number of function evaluations made.
gc : int
Number of gradient evaluations made.
new_fval : float
New function value f(x_new)=f(x0+alpha*pk).
old_fval : float
Old function value f(x0).
new_slope : float
The local slope along the search direction at the new value <myfprime(x_new), pk>.
Notes
Uses the line search algorithm to enforce strong Wolfe conditions. See Wright and Nocedal, ‘Numerical Optimization’, 1999, pg. 59-60.
For the zoom phase it uses an algorithm by [...].