Forward over adjoint for Hessian #85
Replies: 1 comment 3 replies
-
As the Hessian is a second order derivative, the function to be derived with forward mode is no longer a N->1 function. It is a N->N+1 function (the adjoint code for the original function, producing value and all first order derivatives). Therefore it is not possible to produce the Hessian with a single execution of the original function. You would need to loop over each row to produce the full Hessian, clearing the tape, resetting Note that we are planning higher level functions in issue #37 to automate this task with a more convenient API. It will however execute the function multiple times as well, running the steps described above. |
Beta Was this translation helpful? Give feedback.
-
I am trying to compute the Hessian matrix for the example "samples/fwd_adj_2nd/main.cpp". The code describes how to obtain the first row of the Hessian matrix. Can you please explain how to compute the other rows of the matrix? If I change the line no 66 in the code as "derivative(value(x1_ad)) = 1.0;", then the code determines the 2nd row of the Hessian.
Can you please explain how to obtain all the rows in the Hessian matrix?
Beta Was this translation helpful? Give feedback.
All reactions