-
Hi there, I was just wondering, if it is possible to compute second order derivatives using drjit? Here is a simple example of what I want to do: import mitsuba as mi
import drjit as dr
mi.set_variant('cuda_ad_rgb')
a = mi.Float(3)
b = mi.Float(2)
# compute dab/da
dr.set_grad_enabled(a, True)
dr.set_grad(a, mi.Float(1))
ab = a*b
dr.forward_to(ab)
dab_da = dr.grad(ab)
print(f'{dab_da=}')
# TODO compute [dab/da]/db
dr.set_grad_enabled(b, True)
dr.backward_from(dab_da)
ddab_da_db = dr.grad(b)
print(f'{ddab_da_db=}') Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @tomix1024 Drjit doesn't currently support second order derivatives. The few places where we need them we typically the first derivative "manually" and let the autodiff handle the second one. |
Beta Was this translation helpful? Give feedback.
Hi @tomix1024
Drjit doesn't currently support second order derivatives. The few places where we need them we typically the first derivative "manually" and let the autodiff handle the second one.