Table of Contents
Shortcuts

# torch.svd_lowrank

torch.svd_lowrank(A, q=6, niter=2, M=None)

  Return the singular value decomposition `(U, S, V)` of a matrix, batches of matrices, or a sparse matrix A A A such that A≈U d i a g(S)V T A \approx U diag(S) V^T A≈U d ia g(S)V T. In case M M M is given, then SVD is computed for the matrix A−M A - M A−M.

  Note

  The implementation is based on the Algorithm 5.1 from Halko et al, 2009.

  Note

  To obtain repeatable results, reset the seed for the pseudorandom number generator

  Note

  The input is assumed to be a low-rank matrix.

  Note

  In general, use the full-rank SVD implementation `torch.linalg.svd()` for dense matrices due to its 10-fold higher performance characteristics. The low-rank SVD will be useful for huge sparse matrices that `torch.linalg.svd()` cannot handle.

  Args::

    A (Tensor): the input tensor of size (∗,m,n)(*, m, n)(∗,m,n)

    q (int, optional): a slightly overestimated rank of A.

    niter (int, optional): the number of subspace iterations to

      conduct; niter must be a nonnegative integer, and defaults to 2

    M (Tensor, optional): the input tensor’s mean of size

      (∗,1,n)(*, 1, n)(∗,1,n).

  References::

    - Nathan Halko, Per-Gunnar Martinsson, and Joel Tropp, Finding structure with randomness: probabilistic algorithms for constructing approximate matrix decompositions, arXiv:0909.4061 [math.NA; math.PR], 2009 (available at arXiv).

  Return type:

    Tuple[Tensor, Tensor, Tensor]

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.