Skip to content

Bug: Incorrect Gradient for Off-Diagonal Conic Term in Backward Pass #94

@OsamaS99

Description

@OsamaS99

The gradient for the off-diagonal element of the 2D conic matrix in gauss_renderer/cuda_rasterizer/backward.cu is incorrect. It is scaled by 0.5, making it half of the correct value derived from the forward pass calculation.

  • Forward Pass (forward.cu): power = -0.5f * (a*dx² + c*dy²) - b*dx*dy;
  • Correct Derivative of power w.r.t b: -dx*dy
  • Backward Pass (backward.cu): The code incorrectly uses -0.5f * dx*dy to compute the gradient for b.

Change the coefficient for the y component of dL_dconic2D from -0.5f to -1.0f.

- atomicAdd(&dL_dconic2D[global_id].y, -0.5f * gdx * d.y * dL_dG);
+ atomicAdd(&dL_dconic2D[global_id].y, -1.0f * gdx * d.y * dL_dG);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions