threestudio-project / threestudio

A unified framework for 3D content generation.
Apache License 2.0
6.32k stars 480 forks source link

SpecifyGradient is not straghtforward, use a reparameterization trick instead #218

Closed YoujiaZhang closed 1 year ago

YoujiaZhang commented 1 year ago

Thanks for the great job for prolificdreamer and DreamFusion! I have a question about the calculation of SDS loss. I found in the paper g = matmul(weight(t) * (-epshat t - eps), grad(x, params)).

threestudio uses this formula d(loss)/d(latents) = latents - target = latents - (latents - grad) = grad when calculating SDS.

grad = weight(t) * (-epshat t - eps) So is this not calculating grad(x, params) ? I seem to be confused by this. :)

Thanks!

YoujiaZhang commented 1 year ago

I solved it :)