Various eigendecomposition implementations wrapped for jax.
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
jeig - Eigendecompositions wrapped for jax
v0.2.0
Overview
This package wraps eigendecompositions as provided by jax, magma, numpy, scipy, and torch for use with jax. Depending upon your system and your versions of these packages, you may observe significant speed differences.
Install
jeig can be installed via pip,
pip install jeig
This will also install torch. If you only need torch for use with jeig, then the CPU-only version could be sufficient and you may wish to install manually as described in the pytorch docs.
Example usage
import jax
import jeig
matrix = jax.random.normal(jax.random.PRNGKey(0), (8, 320, 320))
jeig.set_backend("jax")
%timeit jeig.eig(matrix)
jeig.set_backend("numpy")
%timeit jeig.eig(matrix)
jeig.set_backend("scipy")
%timeit jeig.eig(matrix)
jeig.set_backend("torch")
%timeit jeig.eig(matrix)
916 ms ± 101 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
1.47 s ± 165 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
782 ms ± 75.4 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
150 ms ± 10.9 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
Credit
The torch implementation of eigendecomposition is due to a comment by @YouJiacheng.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jeig-0.2.0.tar.gz.
File metadata
- Download URL: jeig-0.2.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a858ac9b5c5f4b0157d61cfdc051a3a52ff1d88ce4f55d69b0285a7db2cb563a
|
|
| MD5 |
283b8afc65e307f06a3b403c33ff6cc3
|
|
| BLAKE2b-256 |
16b79e7589be035f551fb94e6dd84645246f7574ff762f125fe3fc4165102dae
|
File details
Details for the file jeig-0.2.0-py3-none-any.whl.
File metadata
- Download URL: jeig-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f39f1f8e8675eedd9cf5cbc0674a737279df482545938719304c1761893bea6
|
|
| MD5 |
fdc3fa45e47e20ab39253aeb0e33e5d9
|
|
| BLAKE2b-256 |
df76762f1bb65cc7b5245bed12c8e469e328b8b7d0b049430badf4da3d06f388
|