Skip to main content

Sketched matrix decompositions for PyTorch

Project description

Skerch logo, light mode Skerch logo, dark mode

skerch: Sketched matrix decompositions for PyTorch

PyPI Installation Documentation CI Coverage
PyPI - Downloads Documentation Status GitHub Actions Workflow Status Coverage Status

skerch is a Python package to compute diagonal decompositions (SVD, Hermitian Eigendecomposition) of linear operators via sketched methods.

  • Built on top of PyTorch, with natural support for CPU and CUDA interoperability, and very few dependencies otherwise
  • Works on matrices and matrix-free operators of potentially very large dimensionality
  • Support for sketched measurements in a fully distributed fashion via HDF5 databases

See the documentation for more details.

Installation and basic usage

Install via:

pip install skerch

The sketched SVD of a linear operator op can be then computed simply via:

q, u, s, vt, pt = ssvd(
    op,
    op_device=DEVICE,
    op_dtype=DTYPE,
    outer_dim=NUM_OUTER,
    inner_dim=NUM_INNER,
)

Where q @ u @ diag(s) @ vt @ pt approximates linop and the number of outer and inner measurements for the sketch is specified.

See Getting Started, Examples, and API docs for more details.

Developers

Contributions are most welcome under this repo's LICENSE. Feel free to open an issue with bug reports, features requests, etc.

The documentation contains a For Developers section with useful guidelines to interact with this repo.

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

skerch-0.6.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

skerch-0.6.0-py3-none-any.whl (60.8 kB view details)

Uploaded Python 3

File details

Details for the file skerch-0.6.0.tar.gz.

File metadata

  • Download URL: skerch-0.6.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for skerch-0.6.0.tar.gz
Algorithm Hash digest
SHA256 54b068f2c9a6885a06edda827a49a996a1246bfaf2c9bc2acfc1c4c9827cc1f2
MD5 ead895e933baf511559340fefb855a0f
BLAKE2b-256 3bbcc9ed5d5378c65b1ca0ac781d8a62914ea800b5fd75b3d0fa476ecd806d4d

See more details on using hashes here.

File details

Details for the file skerch-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: skerch-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 60.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for skerch-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61b8dfc2c6b217cfe3f19252db35a57f8fac672a1671fdb8e096fdd082b5c7b7
MD5 dfcdc02dce49a20978bf4e5d69302512
BLAKE2b-256 86718f1a6c9652f3d3f447f7a1bd31935f70e28258760ee15fc115dd63321739

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