brainpy.math.hessian#

brainpy.math.hessian(func, grad_vars=None, dyn_vars=None, child_objs=None, argnums=None, return_value=False, holomorphic=False)[source]#

Hessian of func as a dense array.

Parameters:
  • func (callable, function) – Function whose Hessian is to be computed. Its arguments at positions specified by argnums should be arrays, scalars, or standard Python containers thereof. It should return arrays, scalars, or standard Python containers thereof.

  • dyn_vars (optional, ArrayCollector, sequence of ArrayType) – The dynamical changed variables.

  • child_objs (optional, BrainPyObject, sequnce, dict) –

    New in version 2.3.1.

  • grad_vars (optional, ArrayCollector, sequence of ArrayType) – The variables required to compute their gradients.

  • argnums (Optional, integer or sequence of integers) – Specifies which positional argument(s) to differentiate with respect to (default 0).

  • holomorphic (bool) – Indicates whether fun is promised to be holomorphic. Default False.

  • return_value (bool) – Whether return the hessian values.

Returns:

obj – The transformed object.

Return type:

ObjectTransform