Skip to content

Higher dimensionnal Hessians #382

Closed
Closed
@Magalame

Description

@Magalame

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions