Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to make sdf calculation differentiable? #9

Open
yangyichu opened this issue Jan 5, 2024 · 1 comment
Open

Is it possible to make sdf calculation differentiable? #9

yangyichu opened this issue Jan 5, 2024 · 1 comment

Comments

@yangyichu
Copy link

Say I have a point p=(xyz), and a distance d = sdf(p), I want to do something like d.backward() to get p.grad? I was able to do it with TORCH_SDF library(a modified version of Kaolin), but it seems I cannot do it with pytorch_volumetric?

@liboyan233
Copy link

I think you may implement this with the sdf_grad in:
sdf_val, sdf_grad = sdf(pts)
However, instead of apply sdf_grad to sdf_val, it should be applied to pts directly. This may because the sdf function is rather implemented in an implicit way, which means there's no analytical differential relationship between sdf_value and pts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants