16 if (
auto i = augmented.find(def); i != augmented.end())
return i->second;
17 augmented[def] =
augment_(def, f, f_diff);
18 return augmented[def];
22 if (
auto i = derived.find(def); i != derived.end())
return i->second;
32 auto arg = ad_app->arg();
33 world().DLOG(
"found a autodiff::autodiff of {}", arg);
39 assert(0 &&
"not implemented");
static auto isa(const Def *def)
const Def * augment(const Def *, Lam *, Lam *)
Applies to (open) expressions in a functional context.
const Def * derive(const Def *)
Acts on toplevel autodiff on closed terms:
const Def * augment_(const Def *, Lam *, Lam *)
Rewrites the given definition in a lambda environment.
const Def * derive_(const Def *)
Additionally to the derivation, the pullback is registered and the maps are initialized.
const Def * rewrite(const Def *) override
Detect autodiff calls.
The automatic differentiation Plugin