clad
clad copied to clipboard
Add user-interface for generating pushforward functions
Clad internally generates pushforward
functions for differentiating function calls in forward mode AD. However, clad::differentiate
, the user-interface for forward mode AD, generates a more restricted form of pushforward
function which does not allow users to tweak the seed values. While pushforward
functions are more difficult to use, they offer more control over the forward mode AD and allow to compute directional derivatives. Higher-order pushforward
functions can even be used to compute partial derivatives such as d2y/dx1dx2
where y
is the output parameter and x1
and x2
are distinct input parameters.
We should keep clad::differentiate
as it is because it is easier to use and add a new function such as clad::pushforward
that allows users to request generation of pushforward functions.