jax.scipy.linalg.svd
Warning
This page was created from a pull request (#9655).
jax.scipy.linalg.svdΒΆ
- jax.scipy.linalg.svd(a, full_matrices=True, compute_uv=True, overwrite_a=False, check_finite=True, lapack_driver='gesdd')[source]ΒΆ
Singular Value Decomposition.
LAX-backend implementation of
svd()
.Original docstring below.
Factorizes the matrix a into two unitary matrices
U
andVh
, and a 1-D arrays
of singular values (real, non-negative) such thata == U @ S @ Vh
, whereS
is a suitably shaped matrix of zeros with main diagonals
.- Parameters
a ((M, N) array_like) β Matrix to decompose.
full_matrices (bool, optional) β If True (default), U and Vh are of shape
(M, M)
,(N, N)
. If False, the shapes are(M, K)
and(K, N)
, whereK = min(M, N)
.compute_uv (bool, optional) β Whether to compute also
U
andVh
in addition tos
. Default is True.overwrite_a (bool, optional) β Whether to overwrite a; may improve performance. Default is False.
check_finite (bool, optional) β Whether to check that the input matrix contains only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.
lapack_driver ({'gesdd', 'gesvd'}, optional) β Whether to use the more efficient divide-and-conquer approach (
'gesdd'
) or general rectangular approach ('gesvd'
) to compute the SVD. MATLAB and Octave use the'gesvd'
approach. Default is'gesdd'
.
- Returns
U (ndarray) β Unitary matrix having left singular vectors as columns. Of shape
(M, M)
or(M, K)
, depending on full_matrices.s (ndarray) β The singular values, sorted in non-increasing order. Of shape (K,), with
K = min(M, N)
.Vh (ndarray) β Unitary matrix having right singular vectors as rows. Of shape
(N, N)
or(K, N)
depending on full_matrices.For
compute_uv=False
, onlys
is returned.