nerfstudio-project / gsplat

CUDA accelerated rasterization of gaussian splatting
https://docs.gsplat.studio/
Apache License 2.0
2.17k stars 273 forks source link

How to add custom backward gradients #465

Open cdcseacave opened 1 week ago

cdcseacave commented 1 week ago

Great project, thank you! This is more a cry for help. I'm trying to add new functionality to the forward renderer, which works great, but next I have huge problems understanding how to write the backward pass.

Do you have any suggestions on how to best approach this task?

YuxinYao620 commented 1 week ago

Hi cdcseacave, may I ask have you resolved this problem?

cdcseacave commented 1 week ago

After a lot of trial and error I think the gradient is computing well now, however I still do not know a good procedure to tackle this task: how to modify/add the derivative in the backward step such that it reflects the forward math changes, and how to best test the changes (I tried using torch.autograd.gradcheck but first of all I had to convert everything to doubles otherwise it does lack accuracy, and even like that it is not obvious if there is a problem how do I spot where in the code it occurs).