chenhsuanlin / bundle-adjusting-NeRF

BARF: Bundle-Adjusting Neural Radiance Fields 🤮 (ICCV 2021 oral)
MIT License
788 stars 114 forks source link

why rescale weight of first layer if in barf mode #78

Closed leo-frank closed 1 year ago

leo-frank commented 1 year ago

Hi, great work on NeRF. I am interested in these lines, can you tell me: why rescale weight of first layer if in barf mode

https://github.com/chenhsuanlin/bundle-adjusting-NeRF/blob/803291bd0ee91c7c13fb5cc42195383c5ade7d15/model/planar.py#L211

Thank you very much for such amazing observation on gradient !

chenhsuanlin commented 1 year ago

Hi @leo-frank, this allows the initial optimization behavior to be equivalent to an MLP where the first layer consumes only a 2-dimensional input. This is very subtle though, and I don't really find it to make a big difference in practice.