jax.numpy.linalg.svd
Warning
This page was created from a pull request (#9655).
jax.numpy.linalg.svdΒΆ
- jax.numpy.linalg.svd(a, full_matrices=True, compute_uv=True, hermitian=False)[source]ΒΆ
Singular Value Decomposition.
LAX-backend implementation of
svd()
.Original docstring below.
When a is a 2D array, it is factorized as
u @ np.diag(s) @ vh = (u * s) @ vh
, where u and vh are 2D unitary arrays and s is a 1D array of aβs singular values. When a is higher-dimensional, SVD is applied in stacked mode as explained below.- Parameters
a ((..., M, N) array_like) β A real or complex array with
a.ndim >= 2
.full_matrices (bool, optional) β If True (default), u and vh have the shapes
(..., M, M)
and(..., N, N)
, respectively. Otherwise, the shapes are(..., M, K)
and(..., K, N)
, respectively, whereK = min(M, N)
.compute_uv (bool, optional) β Whether or not to compute u and vh in addition to s. True by default.
hermitian (bool, optional) β If True, a is assumed to be Hermitian (symmetric if real-valued), enabling a more efficient method for finding singular values. Defaults to False.
- Returns
u ({ (β¦, M, M), (β¦, M, K) } array) β Unitary array(s). The first
a.ndim - 2
dimensions have the same size as those of the input a. The size of the last two dimensions depends on the value of full_matrices. Only returned when compute_uv is True.s ((β¦, K) array) β Vector(s) with the singular values, within each vector sorted in descending order. The first
a.ndim - 2
dimensions have the same size as those of the input a.vh ({ (β¦, N, N), (β¦, K, N) } array) β Unitary array(s). The first
a.ndim - 2
dimensions have the same size as those of the input a. The size of the last two dimensions depends on the value of full_matrices. Only returned when compute_uv is True.