rgl-epfl / recursive_control_variates

Reference implementation of the paper "Recursive Control Variates for Inverse Rendering" (SIGGRAPH 2023)
Other
48 stars 3 forks source link

Unexpected inverse rendering from tutorial #2

Open luci-e opened 9 months ago

luci-e commented 9 months ago

Summary

Hi, not sure if this is an issue or WAI. I couldn't make sense of some results I was getting, so I tried to run the notebook from the Volumetric inverse rendering tutorial as a check.

However I'm getting the following figures:

Intermediate results

intermediate_results

Final results

ohnononono

Another example

dust_devil_op

The code for the first 2 pictures is verbatim from the tutorial. The last picture is just that it seems to be optimizing from the wrong side?

Using cuda_ad_rgb or llvm_ad_rgb yield the same results. Using Mitsuba3 from the main branch works ok.

Sorry in advance if that's a known issue and I just missed it ^^"

System configuration

System information:

OS: Debian GNU/Linux 11 (bullseye) CPU: Intel(R) Core(TM) i9-10900X CPU @ 3.70GHz GPU: NVIDIA GeForce RTX 3090 Python: 3.10.12 (main, Jul 5 2023, 18:54:27) [GCC 11.2.0] NVidia driver: 525.105.17 CUDA: 12.1.105 LLVM: 11.0.1

Dr.Jit: 0.4.0 Mitsuba: 3.2.0 Is custom build? True Compiled with: Clang 11.0.1 Variants: scalar_rgb scalar_spectral cuda_ad_rgb llvm_ad_rgb

bathal1 commented 8 months ago

prbvolpath was modified in the unbiased-volume-opt branch to work with volumes with a majorant supergrid, but differentiation seems to have been broken in the process. Note that in all (heterogeneous) volume experiments of the RCV paper, we use a majorant supergrid, and use the DRT estimator (volpathsimple) for gradient computation.

I'll try to fix the issue with prbvolpath, but in the meantime you should be able to use volpathsimple for your experiments as a drop-in replacement. It is a good idea to use this one for differentiation anyway, since it gives you unbiased (and much lower variance) gradients.

wjakob commented 8 months ago

@bathal1 , was the bug you mentioned introduced in unbiased-volume-opt or on the master branch?

bathal1 commented 8 months ago

It was introduced in unbiased-volume-opt in this commit.

luci-e commented 8 months ago

Thanks! 🙂