Skip to main content

A Python implementation of the MagmaClust algorithm, coded in Jax.

Project description

MagmaClustPy


MagmaClustPy is a probabilistic learning framework based on MagmaClust, a multi-task Gaussian Process framework.

An original implementation of MagmaClust is available as a R package.

This implementation has many limitations:

  • it doesn't do parallel computations and doesn't run on GPU
  • it doesn't support non-gaussian likelihoods (for classification for example)
  • it only models single-output GPs
  • it trains on all the data at once, scaling pretty badly on bigger datasets

This Python package will aleviate these limitations with multiple design choices:

  • We use Jax along with mapping/padding methods to allow fast and parallel computations on CPU/GPU/TPU
  • We develop a multi-output algorithm based on Process Convolution for joint optimisation of correlated outputs
  • We use Laplace-Matching to adapt to non-gaussian data and problems
  • We support data points coming with known, heteroskedastic uncertainty estimates
  • We learn data in batches to reduce time of training
  • We explore sparse covariance matrix computations to speed up inference

Installation

You can install a minimal version of the library using:

pip install magma-py-minimal

Main differences with the original MagmaClustR library

  • This is a module written in Python instead of package coded in R (obviously)
  • The package runs on JAX and can therefore leverage various backends (CPU, GPU, TPU).
  • We use custom classes for kernels rather than string identifiers. These kernels can be composed (à la GPytorch). You can find them in kernels.py. Therefore, signatures of functions that use kernels might be different. A common example of this is the initialisation of kernel HPs. Rather than sending the kernel class and HPs as separate arguments, the user can initialise the kernel with the wanted HP and then send it as a single argument.
  • We use matplotlib for plotting instead of ggplot2
  • Files, class names, functions names, variables and parameters might have different names to be clearer or respect Python conventions.
  • This library sticks with the default precision of the linear algebra backend (or the one specified by the user). No implicit rounding of numbers is performed by the library itself.
  • This library uses logging instead of cat. You can configure the logging level like this: logging.basicConfig(level=logging.INFO).

Development roadmap

  • Cluster mixture init and update
  • Cluster hyperpost and HP optim
  • Model classes
  • Cluster prediction
  • Plot utilities
  • Initializers
  • Prior means modules
  • Likelihood modules
  • Minimal documentation (guides and API)
  • PyPI package and deployment setup

🚀 Alpha release !

  • Bug test - issue management
  • Unit test
  • Multi-output GPs
  • Complete documentation
  • Contribution guides
  • Dev pipeline tools for testing/coverage/...

🚀 1.0.0 release

  • Laplace-Matching likelihoods
  • Continued development

Help, feedback, contributions

Any feedback, issue or contribution is obviously mor than welcome! Don't hesitate to open an issue/discussion on GitHub, or get in touch with Arthur Leroy if you have any question.

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

magma_py_minimal-0.1.2a0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magma_py_minimal-0.1.2a0-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file magma_py_minimal-0.1.2a0.tar.gz.

File metadata

  • Download URL: magma_py_minimal-0.1.2a0.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for magma_py_minimal-0.1.2a0.tar.gz
Algorithm Hash digest
SHA256 eba2a44283434fba6a70b73532c56a88a427f8494e10a86357984c087e7b30c7
MD5 be15b3de87ef84bbf053a37f6da65403
BLAKE2b-256 2b165b48e6dff2c0bdb9cd5b408509f7a67f1b90004733f4e75619f52a6c8e36

See more details on using hashes here.

File details

Details for the file magma_py_minimal-0.1.2a0-py3-none-any.whl.

File metadata

File hashes

Hashes for magma_py_minimal-0.1.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cef64257e226fcaec57a619259659f63e6e12418c82e12e64ad3c5931439daa
MD5 720645a237e4b5a272a7d2ad313e7fbc
BLAKE2b-256 a34320fd9030aa01af3eeabcb662ca50ef397d4c00e01dd92cb1eafba166aabe

See more details on using hashes here.

Supported by

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