TorchLean API

NN.Examples.Factorization.Cholesky

Cholesky Factorization #

Tensor.cholesky A returns a lower-triangular factor candidate. Here we factor a 3×3 symmetric positive-definite matrix and check that its Float reconstruction error is small.

Symmetric positive-definite matrix used for the positive Cholesky check.

Instances For

    Lower-triangular Cholesky factor.

    Instances For

      Reconstruction error $\lVert A-LL^\mathsf{T}\rVert_{\max}$.

      Instances For

        Negative Control #

        Cholesky requires positive pivots. The matrix below is symmetric but not positive-definite (eigenvalues 3 and -1), so the Float computation reaches the square root of a negative value and the reconstruction error becomes NaN.

        A symmetric but indefinite matrix (eigenvalues {3, -1}), outside Cholesky's domain.

        Instances For

          The negative pivot produces a NaN factor entry, making reconstruction fail.

          Instances For

            Reconstruction error for the indefinite case, which should come out NaN.

            Instances For

              Run the positive reconstruction check and its indefinite-matrix negative control.

              Instances For