PyBMF.solvers package¶
Submodules¶
PyBMF.solvers.line_search module¶
- PyBMF.solvers.line_search.limit_step_size(x_min, x_max, x_last, xk, alpha, pk)[source]¶
Limit the step size by limiting
x_lastbyx_minandx_max.This is similar to setting
amaxorextra_conditioninscipy.optimize.line_search.- Parameters:
x_min (array_like)
x_max (array_like)
x_last (array_like)
xk (array_like)
alpha (float)
pk (array_like)
- Returns:
x_last (array_like)
alpha_new (float)
- PyBMF.solvers.line_search.line_search(f, myfprime, xk, pk, args=(), kwargs={}, maxiter=1000, c1=0.1, c2=0.4)[source]¶
Re-implementation of SciPy’s Wolfe line search.
It’s compatible with scipy.optimize.line_search: >>> from scipy.optimize import line_search >>> line_search(f=f, myfprime=myfprime, xk=xk, pk=pk, maxiter=maxiter, c1=c1, c2=c2)
- Parameters:
f (function) – The objective function to be minimized.
myfprime (function) – The gradient of the objective function to be minimized.
xk (array_like) – The starting point for the line search.
pk (array_like) – The search direction for the line search.
args (tuple) – Additional arguments passed to f and myfprime.
kwargs (dict) – Additional keyword arguments passed to f and myfprime.
maxiter (int) – The maximum number of iterations.
c1 (float)
c2 (float)
Module contents¶
- PyBMF.solvers.line_search(f, myfprime, xk, pk, args=(), kwargs={}, maxiter=1000, c1=0.1, c2=0.4)[source]¶
Re-implementation of SciPy’s Wolfe line search.
It’s compatible with scipy.optimize.line_search: >>> from scipy.optimize import line_search >>> line_search(f=f, myfprime=myfprime, xk=xk, pk=pk, maxiter=maxiter, c1=c1, c2=c2)
- Parameters:
f (function) – The objective function to be minimized.
myfprime (function) – The gradient of the objective function to be minimized.
xk (array_like) – The starting point for the line search.
pk (array_like) – The search direction for the line search.
args (tuple) – Additional arguments passed to f and myfprime.
kwargs (dict) – Additional keyword arguments passed to f and myfprime.
maxiter (int) – The maximum number of iterations.
c1 (float)
c2 (float)