jax.numpy.linalg.svd#

jax.numpy.linalg.svd(a: ArrayLike, full_matrices: bool = True, *, compute_uv: Literal[True], hermitian: bool = 'False') Tuple[Array, Array, Array][source]#
jax.numpy.linalg.svd(a: ArrayLike, full_matrices: bool, compute_uv: Literal[True], hermitian: bool = False) Tuple[Array, Array, Array]
jax.numpy.linalg.svd(a: ArrayLike, full_matrices: bool = True, *, compute_uv: Literal[False], hermitian: bool = 'False') Array
jax.numpy.linalg.svd(a: ArrayLike, full_matrices: bool, compute_uv: Literal[False], hermitian: bool = False) Array
jax.numpy.linalg.svd(a: ArrayLike, full_matrices: bool = True, compute_uv: bool = True, hermitian: bool = False) Union[Array, Tuple[Array, Array, Array]]

Singular Value Decomposition.

LAX-backend implementation of numpy.linalg.svd().

Original docstring below.

When a is a 2D array, and full_matrices=False, then it is factorized as u @ np.diag(s) @ vh = (u * s) @ vh, where u and the Hermitian transpose of vh are 2D arrays with orthonormal columns 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, where K = 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.

Return type

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

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.