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

--- TODO ---

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.0a0.tar.gz (27.8 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.0a0-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: magma_py_minimal-0.1.0a0.tar.gz
  • Upload date:
  • Size: 27.8 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.0a0.tar.gz
Algorithm Hash digest
SHA256 5f3e1a24a71ddb45f928fd600bf52dbde5d762929add72733dd41324b7245022
MD5 99f4985894ba4ac97ead5d94453195f7
BLAKE2b-256 bc87d68555af96b065a6ba4bed27132054808b162464725a91d163e5665a5e59

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for magma_py_minimal-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 c741977a45a3958bb85b37975fd4269e55ab70f1b1927366748467c0bdd9531c
MD5 4cfe427c2a22bb27121372d4533adc5b
BLAKE2b-256 b2560c6789b123accefe1b0431a958fe8db956d1e50fd2d8c2b8ecccbc096c42

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