Skip to content

Confusion about Eigenvalue Decomposition of 2D Gaussian Covariance #80

@pyh3552

Description

@pyh3552

forward.cu Line229,230,231

float mid = 0.5f * (cov.x + cov.z);
float lambda1 = mid + sqrt(max(0.1f, mid * mid - det));
float lambda2 = mid - sqrt(max(0.1f, mid * mid - det));

I think the code here is solving the eigenvalues of a symmetric matrix:
$$\det\left([[a-\lambda,b], [b, c-\lambda]]\right)=(a-\lambda)(c-\lambda)-b^{2}=0$$
$$\lambda^{2}-(a+c)\lambda+(ac-b^{2})=0$$
$$\lambda=0.5 * \Bigg[(a+c)\pm \sqrt{(a+c)^{2}-4*(ac-b^{2})}\Bigg]$$

But the code seems to have omitted $0.5*$ and $4*$

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