chainerx.linalg.cholesky

chainerx.linalg.cholesky(a)

Computes the Cholesky decomposition of a matrix.

Returns the Cholesky decomposition, \(A = L L^T\), for the square matrix a.

Parameters

a (ndarray) – Symmetric positive-definite input matrix.

Returns

Output array. Cholesky factor of a.

Return type

ndarray

Note

The forward computation does not necessarily check if the input matrix is symmetric (e.g. the native backend relying on LAPACK does not). However, both the forward and the backward computations assume that it is and their results are unspecified otherwise. The computed gradient is always a symmetric matrix. More specifically, the gradient is computed as if the function is restricted to a Riemannian submanifold of \(R^{n \times n}\) consisting just of positive-definite symmetric matrices and is faithful to the mathematical definition of the Cholesky decomposition.

Note

  • GPU implementation of the Cholesky decomposition routine is based on cuSOLVER library. Older versions (<10.1) of it might not raise an error for some non positive-definite matrices.

  • The dtype must be float32 or float64 (float16 is not supported yet.)