package scipy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `BFGS
]
type t = [ `BFGS | `Object ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val create : ?exception_strategy:[ `Skip_update | `Damp_update ] -> ?min_curvature:float -> ?init_scale:[ `F of float | `Auto ] -> unit -> t

Broyden-Fletcher-Goldfarb-Shanno (BFGS) Hessian update strategy.

Parameters ---------- exception_strategy : 'skip_update', 'damp_update', optional Define how to proceed when the curvature condition is violated. Set it to 'skip_update' to just skip the update. Or, alternatively, set it to 'damp_update' to interpolate between the actual BFGS result and the unmodified matrix. Both exceptions strategies are explained in 1_, p.536-537. min_curvature : float This number, scaled by a normalization factor, defines the minimum curvature ``dot(delta_grad, delta_x)`` allowed to go unaffected by the exception strategy. By default is equal to 1e-8 when ``exception_strategy = 'skip_update'`` and equal to 0.2 when ``exception_strategy = 'damp_update'``. init_scale : float, 'auto' Matrix scale at first iteration. At the first iteration the Hessian matrix or its inverse will be initialized with ``init_scale*np.eye(n)``, where ``n`` is the problem dimension. Set it to 'auto' in order to use an automatic heuristic for choosing the initial scale. The heuristic is described in 1_, p.143. By default uses 'auto'.

Notes ----- The update is based on the description in 1_, p.140.

References ---------- .. 1 Nocedal, Jorge, and Stephen J. Wright. 'Numerical optimization' Second Edition (2006).

val dot : p:[> `Ndarray ] Np.Obj.t -> [> tag ] Obj.t -> [ `ArrayLike | `Ndarray | `Object ] Np.Obj.t

Compute the product of the internal matrix with the given vector.

Parameters ---------- p : array_like 1-D array representing a vector.

Returns ------- Hp : array 1-D represents the result of multiplying the approximation matrix by vector p.

val get_matrix : [> tag ] Obj.t -> [ `ArrayLike | `Ndarray | `Object ] Np.Obj.t

Return the current internal matrix.

Returns ------- M : ndarray, shape (n, n) Dense matrix containing either the Hessian or its inverse (depending on how `approx_type` was defined).

val initialize : n:int -> approx_type:[ `Hess | `Inv_hess ] -> [> tag ] Obj.t -> Py.Object.t

Initialize internal matrix.

Allocate internal memory for storing and updating the Hessian or its inverse.

Parameters ---------- n : int Problem dimension. approx_type : 'hess', 'inv_hess' Selects either the Hessian or the inverse Hessian. When set to 'hess' the Hessian will be stored and updated. When set to 'inv_hess' its inverse will be used instead.

val update : delta_x:[> `Ndarray ] Np.Obj.t -> delta_grad:[> `Ndarray ] Np.Obj.t -> [> tag ] Obj.t -> Py.Object.t

Update internal matrix.

Update Hessian matrix or its inverse (depending on how 'approx_type' is defined) using information about the last evaluated points.

Parameters ---------- delta_x : ndarray The difference between two points the gradient function have been evaluated at: ``delta_x = x2 - x1``. delta_grad : ndarray The difference between the gradients: ``delta_grad = grad(x2) - grad(x1)``.

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

val pp : Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.