python中的minimize方法中的前三个参数含义

199 阅读2分钟

Parameters ----------

fun : callable
    The objective function to be minimized.

        fun(x, *args) -> float``

    where ``x`` is a 1-D array with shape (n,) and ``args``
    is a tuple of the fixed parameters needed to completely
    specify the function.
x0 : ndarray, shape (n,)
    Initial guess. Array of real elements of size (n,),
    where ``n`` is the number of independent variables.
args : tuple, optional
    Extra arguments passed to the objective function and its
    derivatives (`fun`, `jac` and `hess` functions).
method : str or callable, optional
    Type of solver.  Should be one of

        - 'Nelder-Mead' :ref:`(see here) <optimize.minimize-neldermead>`
        - 'Powell'      :ref:`(see here) <optimize.minimize-powell>`
        - 'CG'          :ref:`(see here) <optimize.minimize-cg>`
        - 'BFGS'        :ref:`(see here) <optimize.minimize-bfgs>`
        - 'Newton-CG'   :ref:`(see here) <optimize.minimize-newtoncg>`
        - 'L-BFGS-B'    :ref:`(see here) <optimize.minimize-lbfgsb>`
        - 'TNC'         :ref:`(see here) <optimize.minimize-tnc>`
        - 'COBYLA'      :ref:`(see here) <optimize.minimize-cobyla>`
        - 'SLSQP'       :ref:`(see here) <optimize.minimize-slsqp>`
        - 'trust-constr':ref:`(see here) <optimize.minimize-trustconstr>`
        - 'dogleg'      :ref:`(see here) <optimize.minimize-dogleg>`
        - 'trust-ncg'   :ref:`(see here) <optimize.minimize-trustncg>`
        - 'trust-exact' :ref:`(see here) <optimize.minimize-trustexact>`
        - 'trust-krylov' :ref:`(see here) <optimize.minimize-trustkrylov>`
        - custom - a callable object, see below for description.

    If not given, chosen to be one of ``BFGS``, ``L-BFGS-B``, ``SLSQP``,
    depending on whether or not the problem has constraints or bounds.
    
    

参数 ---------- 乐趣:可调用 要最小化的目标函数。

''fun(x, *args) -> float''

其中“x”是形状为 (n,) 和“args”的一维数组 是完全需要的固定参数的元组 指定函数。

x0 : 阵列,形状 (n,)
    初步猜测。大小为 (n,) 的实数组元素数组,
    其中“n”是自变量的数量。
参数:元组,可选
    传递给目标函数及其的额外参数
    衍生物(“乐趣”、“JAC”和“HESS”函数)。
方法:STR或可调用,可选
    求解器的类型。 应该是其中之一
  • 'Nelder-Mead' :

  • ref:'(见这里) <optimize.minimize-neldermead>'

          - '鲍威尔'ref:“(见这里) <优化.最小化-鲍威尔>'
          - 'CG' :ref:'(见这里) <优化.最小化-cg>'
          - 'BFGS' :ref:'(见这里) <优化.最小化-BFGS>'
          - 'Newton-CG' :ref:'(见这里) <optimize.minimize-newtoncg>'
         
          - 'L-BFGS-B' :ref:'(见这里) <optimize.minimize-lbfgsb>'
          - 'TNC' :ref:“(见这里) <优化.最小化-tnc>'
          - 'COBYLA'ref'(见这里) <optimize.minimize-cobyla>'
          - 'SLSQP'ref'(见这里) <optimize.minimize-slsqp>'
          - 'trust-constr'ref'(见这里) <optimize.minimize-trustconstr>'
          - 'dogleg'ref:“(见这里) <optimize.minimize-dogleg>'
          - 'trust-ncg' :ref:'(见这里) <optimize.minimize-trustncg>'
          - 'trust-exact' :ref:'(见这里) <optimize.minimize-trustexact>'
          - 'Trust-Krylov' :ref:'(见这里) <优化.最小化-信任Krylov>'
          - 自定义 - 可调用的对象,请参阅下面的说明。
    

如果没有给出,则选择成为“BFGS”,“L-BFGS-B”,“SLSQP”之一, 取决于问题是否有约束或边界。

Parameter fun of scipy.optimize._minimize.minimize fun: Callable The objective function to be minimized. fun(x, *args) -> float where x is a 1-D array with shape (n,) and args is a tuple of the fixed parameters needed to completely specify the function.

参数乐趣 scipy.optimize._minimize.最小化乐趣:可调用 要最小化的目标函数。''fun(x, *args) -> float'' 其中 'x'' 是一个形状为 (n,) 的一维数组,''args'' 是完全指定函数所需的固定参数元组。