You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
by providing the rule config and specifying the `rrule_via_ad` as the `rrule_f` keyword argument.
196
+
197
+
198
+
### How to write `rrule_via_ad` function
199
+
200
+
`rrule_via_ad` will use the AD system to compute gradients and will package them in the `rrule`-like API.
187
201
188
202
Let's say the AD package uses some custom differential types and does not provide a gradient w.r.t. the function itself.
189
203
In order to make the pullback compatible with the `rrule` API we need to add a `NoTangent()` to represent the differential w.r.t. the function itself.
190
204
We also need to transform the `ChainRules` differential types to the custom types (`cr2custom`) before feeding the `Δ` to the AD-generated pullback, and back to `ChainRules` differential types when returning from the `rrule` (`custom2cr`).
0 commit comments