Skip to main content

Sketched matrix decompositions for PyTorch

Project description

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.5.0.tar.gz (1.6 MB view hashes)

Uploaded Source

Built Distribution

skerch-0.5.0-py3-none-any.whl (60.8 kB view hashes)

Uploaded Python 3

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