Skip to main content

Various eigendecomposition implementations wrapped for jax.

Project description

jeig - Eigendecompositions wrapped for jax

v0.1.2

Overview

This package wraps eigendecompositions as provided by jax, numpy, scipy, and torch for use with jax. Depending upon your system and your versions of these packages, you may observe significant speed differences.

Speed comparison

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jeig-0.1.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

jeig-0.1.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file jeig-0.1.2.tar.gz.

File metadata

  • Download URL: jeig-0.1.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for jeig-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3412b740eec6da2761c88510ce7fa695db8a1d9c3bebabcf56adc88379bd2791
MD5 77b381a31907761d564c4eec49405663
BLAKE2b-256 bf73ba9233a9fed87f155975ff1c8795ee2165a83434fad4c70bbd96a3ff0f8f

See more details on using hashes here.

File details

Details for the file jeig-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: jeig-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for jeig-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 66ce4715bb795d998119053ece51f4d8dabe4e30115013c1259e25533bf4d00b
MD5 d93a2efd531ae2ae79d9fb4144709a6b
BLAKE2b-256 a75156968b848b208a142289cf27ce38091be272cd74387a1164141835a20610

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page