Skip to main content
`Ctrl`+`K`

# minimize(method=’CG’)

scipy.optimize.minimize(fun, x0, args=(), method=None, jac=None, hess=None, hessp=None, bounds=None, constraints=(), tol=None, callback=None, options=None)

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

  See also

  For documentation for the rest of the parameters, see `scipy.optimize.minimize`

  Options:
    ——-
    disp bool

      Set to True to print convergence messages.

    maxiter int

      Maximum number of iterations to perform.

    gtol float

      Gradient norm must be less than gtol before successful termination.

    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.

    c1 float, default: 1e-4

      Parameter for Armijo condition rule.

    c2 float, default: 0.4

      Parameter for curvature condition rule.

    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)`.

      Added in version 1.16.0.

  Notes

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