jax.scipy.linalg.svd#

jax.scipy.linalg.svd(a: Union[jax.Array, numpy.ndarray, numpy.bool_, numpy.number, bool, int, float, complex], full_matrices: bool = True, compute_uv: Literal[True] = True, overwrite_a: bool = False, check_finite: bool = True, lapack_driver: str = 'gesdd') Tuple[jax.Array, jax.Array, jax.Array][source]#
jax.scipy.linalg.svd(a: Union[jax.Array, numpy.ndarray, numpy.bool_, numpy.number, bool, int, float, complex], full_matrices: bool, compute_uv: Literal[False], overwrite_a: bool = False, check_finite: bool = True, lapack_driver: str = 'gesdd') jax.Array
jax.scipy.linalg.svd(a: Union[jax.Array, numpy.ndarray, numpy.bool_, numpy.number, bool, int, float, complex], full_matrices: bool = True, *, compute_uv: Literal[False], overwrite_a: bool = 'False', check_finite: bool = 'True', lapack_driver: str = "'gesdd'") jax.Array
jax.scipy.linalg.svd(a: Union[jax.Array, numpy.ndarray, numpy.bool_, numpy.number, bool, int, float, complex], full_matrices: bool = True, compute_uv: bool = True, overwrite_a: bool = False, check_finite: bool = True, lapack_driver: str = 'gesdd') Union[jax.Array, Tuple[jax.Array, jax.Array, jax.Array]]

Singular Value Decomposition.

LAX-backend implementation of scipy.linalg._decomp_svd.svd().

Does not support the Scipy argument check_finite=True, because compiled JAX code cannot perform checks of array values at runtime.

Does not support the Scipy argument overwrite_*=True.

Original docstring below.

Factorizes the matrix a into two unitary matrices U and Vh, and a 1-D array s of singular values (real, non-negative) such that a == U @ S @ Vh, where S is a suitably shaped matrix of zeros with main diagonal s.

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), where K = min(M, N).

  • compute_uv (bool, optional) – Whether to compute also U and Vh in addition to s. Default is True.

  • overwrite_a (bool) –

  • check_finite (bool) –

  • lapack_driver (str) –

Return type

Union[Array, Tuple[Array, Array, Array]]

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, only s is returned.