question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make SVD code faster

See original GitHub issue

I’ve found that scipy’s implementation of the lanczos algorithm is extremely fast for finding eigenvalues and eigenvectors of a big, sparse real symmetric square matrix (I’m pretty sure more so than sklearn’s randomized_svd or scipy’s sparse.linalg.svds, although this all needs to be tested empirically).

in the case of undirected graphs, our adjacency matrices are going to be square and symmetric, so the singular values will be the eigenvalues (right?), and most of them are going to be pretty sparse

So a potential NDD project could be testing the various algorithms for finding eigenvalues, eigenvectors, and more generally doing SVDs for speed, on different types of matrices, and then using the ones that are fastest in e.g. SelectSVD, and then adding some blurb in the docs about when it is appropriate to use which algorithm.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rajpratyushcommented, Apr 14, 2021

I am going for #208 first

0reactions
loftusacommented, Apr 21, 2021

Restarted Lanczos Method: https://link.springer.com/article/10.1007/s11075-006-9057-z

https://onlinelibrary.wiley.com/doi/abs/10.1002/nme.1478

I cannot read these articles. Can you help ?@loftusa

a magic website you didn’t hear about from me: https://sci-hub.se/ warning: these articles are very dense and math-heavy. Maybe better to make jupyter notebooks with speed comparisons first, then read articles after to go deeper and learn whats going on under the hood

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simple SVD algorithms. Naive ways to calculate SVD
Aim of this post is to show some simple and educational examples how to calculate singular value decomposition using simple methods.
Read more >
The SVD “transpose trick” — save time and make heavy matrix ...
The SVD “transpose trick” — save time and make heavy matrix calculations possible. Benchmark results and reproducible code for an SVD short-cut ...
Read more >
Speed up SVD in PyTorch - python - Stack Overflow
svd on CPU tensors. I found that randomized_svd was only about 2x faster. Your results will depend on the actual data. Also, svds...
Read more >
How to Calculate the SVD from Scratch with Python
All matrices have an SVD, which makes it more stable than other methods, ... tutorials and the Python source code files for all...
Read more >
LazySVD: Even Faster SVD Decomposition Yet Without ...
spectral norm (q = ∞) and Frobenius norm (q = 2), therefore making k-SVD a ... Traditional algorithms to compute SVD essentially run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found