https://github.com/skailasa/pyrsvd
Accelerated Randomised SVD in Python
https://github.com/skailasa/pyrsvd
cuda numba python3 randomised-algorithms svd
Last synced: 5 months ago
JSON representation
Accelerated Randomised SVD in Python
- Host: GitHub
- URL: https://github.com/skailasa/pyrsvd
- Owner: skailasa
- License: mit
- Created: 2021-02-01T13:08:38.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-27T23:05:56.000Z (over 4 years ago)
- Last Synced: 2023-03-07T06:46:31.740Z (over 2 years ago)
- Topics: cuda, numba, python3, randomised-algorithms, svd
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PyRSVD - Accelerated Randomised SVD in Python
Perform fast rSVD accelerated using the CUDA, all in Python.
## Install
Install from source into a Conda/Miniconda environment.
```bash
git clone git@github.com:skailasa/pyrsvd.git
cd pyrsvdconda build conda.recipe
conda install --use-local pyrsvd
```## Usage
```python
import numpy as npimport pyrsvd
# Instantiate a 'tall' and 'thin' matrix to compress
M = 123
N = 45
A = np.random.rand(M, N)# Choose a target rank
K = 5u, s, vt = pyrsvd.svd(A, K)
```## Benchmark
Benchmarked for 'thin' and 'tall' matrices, versus NumPy implementation on a 8th generation Intel i7 CPU and an NVidia Quadro RTX 3000 Mobile GPU, including data transfer times, with a target compression rank of K=1.
### 1) Dense Matrix
![]()
## References
[1] Halko, N., Martinsson, P. G., & Tropp, J. A. (2011). Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM review, 53(2), 217-288.