scipy.optimize.

rosen_hess#

scipy.optimize.rosen_hess(x)[source] #

The Hessian matrix of the Rosenbrock function.

Parameters:
xarray_like

1-D array of points at which the Hessian matrix is to be computed.

Returns:
rosen_hessndarray

The Hessian matrix of the Rosenbrock function at x.

Notes

rosen_hess has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.

Library

CPU

GPU

NumPy

n/a

CuPy

n/a

PyTorch

JAX

Dask

n/a

See Support for the array API standard for more information.

Examples

>>> importnumpyasnp
>>> fromscipy.optimizeimport rosen_hess
>>> X = 0.1 * np.arange(4)
>>> rosen_hess(X)
array([[-38., 0., 0., 0.],
 [ 0., 134., -40., 0.],
 [ 0., -40., 130., -80.],
 [ 0., 0., -80., 200.]])
On this page