Automatic differentiation backends of the sensitivity methods
Source:R/sensitivity-backends.R
sensitivity_backends.RdJulia computes the vector Jacobian products of the adjoint methods with
an automatic differentiation backend chosen by autojacvec. R has no
automatic differentiation, so the backend objects ZygoteVJP(),
EnzymeVJP(), ReverseDiffVJP(compile), TrackerVJP(), MooncakeVJP()
and ReactantVJP() all select the exact vector Jacobian products: the
symbolic derivatives of the System the problem was built from, or the
problem's jac_fn and central finite differences for problems built from
R functions (as autojacvec = TRUE). ReactantVJPConfig() holds the
options of the Reactant backend (unused).
Usage
ZygoteVJP(allow_nothing = FALSE)
EnzymeVJP(...)
ReverseDiffVJP(compile = FALSE)
TrackerVJP(allow_nothing = FALSE)
MooncakeVJP(...)
ReactantVJP(...)
ReactantVJPConfig(...)
ZygoteAdjoint()
EnzymeAdjoint(mode = NULL)
ReverseDiffAdjoint(compile = FALSE)
TrackerAdjoint()
MooncakeAdjoint()Details
The discretize then optimize adjoints ZygoteAdjoint(),
EnzymeAdjoint(), ReverseDiffAdjoint(), TrackerAdjoint() and
MooncakeAdjoint() differentiate through the solver in Julia; in R they
are the forward sensitivities of the discretized solve,
ForwardDiffSensitivity(), which give the derivatives of the computed
solution.
Examples
InterpolatingAdjoint(autojacvec = ZygoteVJP())
#> InterpolatingAdjoint(autojacvec = ZygoteVJP, checkpointing = FALSE, noisemixing = FALSE)
ZygoteAdjoint()
#> ZygoteAdjoint()