MCPcopy Create free account
hub / github.com/dask/dask / svd_compressed

Function svd_compressed

dask/array/linalg.py:746–832  ·  view source on GitHub ↗

Randomly compressed rank-k thin Singular Value Decomposition. This computes the approximate singular value decomposition of a large array. This algorithm is generally faster than the normal algorithm but does not provide exact results. One can balance between performance and accur

(
    a,
    k,
    iterator="power",
    n_power_iter=0,
    n_oversamples=10,
    seed=None,
    compute=False,
    coerce_signs=True,
)

Source from the content-addressed store, hash-verified

744
745
746def svd_compressed(
747 a,
748 k,
749 iterator="power",
750 n_power_iter=0,
751 n_oversamples=10,
752 seed=None,
753 compute=False,
754 coerce_signs=True,
755):
756 """Randomly compressed rank-k thin Singular Value Decomposition.
757
758 This computes the approximate singular value decomposition of a large
759 array. This algorithm is generally faster than the normal algorithm
760 but does not provide exact results. One can balance between
761 performance and accuracy with input parameters (see below).
762
763 Parameters
764 ----------
765 a: Array
766 Input array
767 k: int
768 Rank of the desired thin SVD decomposition.
769 iterator: {'power', 'QR'}, default='power'
770 Define the technique used for iterations to cope with flat
771 singular spectra or when the input matrix is very large.
772 n_power_iter: int, default=0
773 Number of power iterations, useful when the singular values
774 decay slowly. Error decreases exponentially as `n_power_iter`
775 increases. In practice, set `n_power_iter` <= 4.
776 n_oversamples: int, default=10
777 Number of oversamples used for generating the sampling matrix.
778 This value increases the size of the subspace computed, which is more
779 accurate at the cost of efficiency. Results are rarely sensitive to this choice
780 though and in practice a value of 10 is very commonly high enough.
781 compute : bool
782 Whether or not to compute data at each use.
783 Recomputing the input while performing several passes reduces memory
784 pressure, but means that we have to compute the input multiple times.
785 This is a good choice if the data is larger than memory and cheap to
786 recreate.
787 coerce_signs : bool
788 Whether or not to apply sign coercion to singular vectors in
789 order to maintain deterministic results, by default True.
790
791
792 Examples
793 --------
794 >>> u, s, v = svd_compressed(x, 20) # doctest: +SKIP
795
796 Returns
797 -------
798 u: Array, unitary / orthogonal
799 s: Array, singular values in decreasing order (largest first)
800 v: Array, unitary / orthogonal
801
802 References
803 ----------

Calls 6

waitFunction · 0.90
svd_flipFunction · 0.90
compression_matrixFunction · 0.85
tsqrFunction · 0.85
persistMethod · 0.45
dotMethod · 0.45