▲ | imtringued 3 days ago | |
You're confusing too many things. The Hessian is defined as the second order partial derivative of a scalar function. Therefore it will always give you a matrix. What you're doing with the shape (m,n,n) isn't actually guaranteed at all since the output shape of an arbitrary function can be any tensor and you can apply the Hessian to each scalar value in the tensor to get another arbitrary tensor that has two dimensions more. It's the Jacobian that is weird, since it is just a vector of gradients and therefore its partial derivative must also be a vector of Hessians. |