class brainpy.math.hessian(func, grad_vars=None, argnums=None, has_aux=None, holomorphic=False)[source]#

Hessian of func as a dense array.

  • 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.

  • 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.

  • has_aux (bool, optional) – Indicates whether fun returns a pair where the first element is considered the output of the mathematical function to be differentiated and the second element is auxiliary data. Default False.


obj – The transformed object.

Return type: