Expand description
Linear algebra following jax.numpy.linalg (and NumPy’s semantics), on
matrices and batches of matrices (see lax::linalg
for the decompositions). The decompositions and solves (cholesky,
solve, inv, qr, eigh, eigvalsh, svd, svdvals) take f32,
f64, c64, and c128; det, slogdet, and norm take f32 and
f64.
Enums§
Functions§
- cholesky
- The Cholesky factor
L(lower triangular,a = L L^T) of each symmetric positive definite matrix, asjnp.linalg.cholesky(the input is symmetrized first). Matrices that are not positive definite give NaNs. - det
- The determinant of each square matrix, as
jnp.linalg.det: the sign times the exponential of the log-determinant fromslogdet(JAX uses closed forms for 2 x 2 and 3 x 3 matrices, which round differently). - eigh
- The eigenvalues (ascending) and eigenvectors (columns) of each symmetric
matrix, as
jnp.linalg.eigh(the input is symmetrized first). - eigvalsh
- The eigenvalues (ascending) of each symmetric matrix, as
jnp.linalg.eigvalsh. - inv
- The inverse of each square matrix, as
jnp.linalg.inv(a solve with the identity). - norm
- A norm of vectors or matrices, as
jnp.linalg.norm. - qr
- The QR decomposition of each matrix, as
jnp.linalg.qr(NumPy’s mode"r"is the second result). - slogdet
- The sign and the natural logarithm of the absolute value of the
determinant of each square matrix, as
jnp.linalg.slogdet(from the LU factorization). Singular matrices give a sign of 0 and-inf. - solve
- Solves
a x = bforx, asjnp.linalg.solve:bof shape[n]is a vector (the result is[..., n]), otherwise a batch of matrices[..., n, k]whose batch dimensions broadcast witha’s. The solve uses the LU factorization ofa; singular matrices give infinities or NaNs. - svd
- The singular value decomposition
(u, s, vh)of each matrix, asjnp.linalg.svd(seelax::linalg::svd). - svdvals
- The singular values of each matrix in descending order, as
jnp.linalg.svdvals.