Evaluation Hessian of a Control paramater + Eigendecomposition #3312
-
Hello everyone,
Now i would like the compute the hessian of J w.r.t. f (dJ^2/df^2) But since J do not depend explicitely of f i cant use the automatic differentiation, so is there a way to estimate such hessian ? best, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
What does your control space look like? For the general case where your control is a Function you generally don't want to construct the entire Hessian, as it would be too costly. pyadjoint does provide the functionality to efficiently calculate the Hessian in a certain direction, i.e. the Hessian matrix multiplied by a given vector: http://www.dolfin-adjoint.org/en/release/documentation/pyadjoint_api.html#pyadjoint.compute_hessian |
Beta Was this translation helpful? Give feedback.
The operation you are trying to do is above the level of Firedrake. Firedrake (and pyadjoint) can give you the hessian action, as described above. You need to wrap this in a PETSc matrix object in order to then have slepc do a matrix-free Eigen problem. You can take inspiration for the construction of the matrix from the way that we construct matrix-free petsc Mats using a form action. This is described in the documentation here: https://www.firedrakeproject.org/matrix-free.html#matrix-free-operators and that links to the code for ImplicitMatrix and ImplicitMatrix context. Note that you can't use that code directly because it's for the Firedrake case where the matrix action is given by as…