drjit icon indicating copy to clipboard operation
drjit copied to clipboard

Second order derivative?

Open radenmuaz opened this issue 2 years ago • 2 comments

Is it possible to do backward_to of a Float variable to itself? Is there a standard way to do something like jax's .hessian, .jacrev, .jacfwd ?

radenmuaz avatar Jul 31 '22 16:07 radenmuaz

Dear @radenmuaz,

An official reply wouldn't be available until mid August since most of the team is off for vacation and Siggraph (https://github.com/mitsuba-renderer/mitsuba3/discussions/123).

AFAIK, we do not have any second order support. We cannot differentiate the AD graph itself either (in other words, dr.grad(vec) is a fully detached vector). I am uncertain if this will be added to the TODO list later. The last time I needed a second derivative, I did that part of the computation in another framework and copied the result back.

Best

ziyi-zhang avatar Aug 03 '22 08:08 ziyi-zhang

Is it possible to do backward_to of a Float variable to itself?

In DrJIT this will result in a no-op. Although I am not really sure to understand what you are expecting from it. Could you maybe provide a snippet example to illustrate what you mean?

Other than that, as mentioned above, second order derivates aren't supported in Dr.JIT.

Speierers avatar Aug 15 '22 04:08 Speierers