Compute the Hessian matrix of a scalar-valued function.
The Hessian is the matrix of second-order partial derivatives of a function. This is implemented as jacfwd(grad(f)).
jacfwd(grad(f))
const f = (x: np.Array) => np.sum(x.ref.mul(x.ref).mul(x)); // x^3const H = hessian(f)(np.array([1, 2, 3]));// H[i,j] = d^2f / dx_i dx_j Copy
const f = (x: np.Array) => np.sum(x.ref.mul(x.ref).mul(x)); // x^3const H = hessian(f)(np.array([1, 2, 3]));// H[i,j] = d^2f / dx_i dx_j
Compute the Hessian matrix of a scalar-valued function.
The Hessian is the matrix of second-order partial derivatives of a function. This is implemented as
jacfwd(grad(f)).