NVlabs / nvdiffrec

Official code for the CVPR 2022 (oral) paper "Extracting Triangular 3D Models, Materials, and Lighting From Images".
Other
2.13k stars 223 forks source link

question about code details #148

Closed lcc815 closed 10 months ago

lcc815 commented 10 months ago

i am confused of these two lines of code: here and here why should the grad be rescaled?

Thanks,

jmunkberg commented 10 months ago

Hello @lcc815 ,

For the first line: It converged better with a gradient scaling of the light gradient. For the second line: We perform gradient scaling in the MLP code https://github.com/NVlabs/nvdiffrec/blob/main/render/mlptexture.py (that helped convergence), and the division is there to partly compensate for that scaling.

These hyperparameters were used to generate the results in the paper, but are heuristically chosen. Feel free to experiment with other values.

lcc815 commented 10 months ago

thanks for the soon reply :)