Skip to content

correct random svd example #480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dislib/decomposition/randomsvd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def random_svd(a, iters, epsilon, tol, nsv=None, k=None, verbose=False):
--------
>>> import numpy as np
>>> import dislib as ds
>>> from dislib.decomposition import lanczos_svd
>>> from dislib.decomposition import random_svd
>>>
>>> def create_matrix(m, n):
>>> # Define the range of exponents for the singular values
Expand All @@ -266,7 +266,7 @@ def random_svd(a, iters, epsilon, tol, nsv=None, k=None, verbose=False):
>>> def main():
>>> A, sing_values = create_matrix(50000, 150)
>>> A = ds.array(A, block_size=(50000, 20))
>>> u, s, v = lanczos_svd(A, iters=5, epsilon=0.5, tol=1e-3,
>>> u, s, v = random_svd(A, iters=5, epsilon=0.5, tol=1e-3,
>>> nsv=15, k=40, verbose=True)
>>> s = s.collect()
>>> print("Singular values computed: " + str(s), flush=True)
Expand Down