Closed
Description
Hi!
I was wondering if there was a practical way to produce an array (of size m
) of n*n
Hessians for a function f: R^n -> R^m
.
I checked out vector_hessian
from the docs, but it seems to give a weird output. For example, I'd get
[:, :, 1] =
10 10
2 -8
[:, :, 2] =
0 -8
-8 0
[:, :, 3] =
-8 0
4 4
Instead of
[:, :, 1] =
10 -8
-8 4
[:, :, 2] =
2 0
0 0
[:, :, 3] =
10 -8
-8 4
I suspect I'm just poorly using the reshape
function: I pass out
to reshape(n,n,m)
Thanks!
Metadata
Metadata
Assignees
Labels
No labels