{ } Raw JSON

bundles / scipy 1.17.1 / scipy / optimize / _optimize / _minimize_bfgs

function

scipy.optimize._optimize:_minimize_bfgs

source: /scipy/optimize/_optimize.py :1345

Signature

def   _minimize_bfgs ( fun x0 args = () jac = None callback = None gtol = 1e-05 norm = inf eps = 1.4901161193847656e-08 maxiter = None disp = False return_all = False finite_diff_rel_step = None xrtol = 0 c1 = 0.0001 c2 = 0.9 hess_inv0 = None workers = None ** unknown_options )

Summary

Minimization of scalar function of one or more variables using the BFGS algorithm.

Parameters

disp : bool

Set to True to print convergence messages.

maxiter : int

Maximum number of iterations to perform.

gtol : float

Terminate successfully if gradient norm is less than gtol.

norm : float

Order of norm (Inf is max, -Inf is min).

eps : float or ndarray

If jac is None the absolute step size used for numerical approximation of the jacobian via forward differences.

return_all : bool, optional

Set to True to return a list of the best solution at each of the iterations.

finite_diff_rel_step : None or array_like, optional

If jac in ['2-point', '3-point', 'cs'] the relative step size to use for numerical approximation of the jacobian. The absolute step size is computed as h = rel_step * sign(x) * max(1, abs(x)), possibly adjusted to fit into the bounds. For jac='3-point' the sign of h is ignored. If None (default) then step is selected automatically.

xrtol : float, default: 0

Relative tolerance for x. Terminate successfully if step size is less than xk * xrtol where xk is the current parameter vector.

c1 : float, default: 1e-4

Parameter for Armijo condition rule.

c2 : float, default: 0.9

Parameter for curvature condition rule.

hess_inv0 : None or ndarray, optional

Initial inverse hessian estimate, shape (n, n). If None (default) then the identity matrix is used.

workers : int, map-like callable, optional

A map-like callable, such as multiprocessing.Pool.map for evaluating any numerical differentiation in parallel. This evaluation is carried out as workers(fun, iterable).

Notes

Parameters c1 and c2 must satisfy 0 < c1 < c2 < 1.

If minimization doesn't complete successfully, with an error message of Desired error not necessarily achieved due to precision loss, then consider setting gtol to a higher value. This precision loss typically occurs when the (finite difference) numerical differentiation cannot provide sufficient precision to satisfy the gtol termination criterion. This can happen when working in single precision and a callable jac is not provided. For single precision problems a gtol of 1e-3 seems to work.

Aliases

  • scipy.optimize._minimize._minimize_bfgs