Skip to main content

Stitching together probabilistic models and inference.

Project description

Bayeux

Stitching together models and samplers

Unittests PyPI version

bayeux lets you write a probabilistic model in JAX and immediately have access to state-of-the-art inference methods. The API aims to be simple, self descriptive, and helpful. Simply provide a log density function (which doesn't even have to be normalized), along with a single point (specified as a pytree) where that log density is finite. Then let bayeux do the rest!

Installation

pip install bayeux-ml

Quickstart

We define a model by providing a log density in JAX. This could be defined using a probabilistic programming language (PPL) like numpyro, PyMC, TFP, distrax, oryx, coix, or directly in JAX.

import bayeux as bx
import jax

normal_density = bx.Model(
  log_density=lambda x: -x*x,
  test_point=1.)

seed = jax.random.key(0)

opt_results = normal_density.optimize.optax_adam(seed=seed)
# OR!
idata = normal_density.mcmc.numpyro_nuts(seed=seed)
# OR!
surrogate_posterior, loss = normal_density.vi.tfp_factored_surrogate_posterior(seed=seed)

Read more

This is not an officially supported Google product.

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

bayeux_ml-0.1.11.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

bayeux_ml-0.1.11-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file bayeux_ml-0.1.11.tar.gz.

File metadata

  • Download URL: bayeux_ml-0.1.11.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for bayeux_ml-0.1.11.tar.gz
Algorithm Hash digest
SHA256 27a0bb667c09a1d279da3b3750359e13afe3ee335e2c726728c747868001c506
MD5 d8a69d3d3a87140d90dd7b20ab628a81
BLAKE2b-256 898542af0c77454b634e15aceb11edd2351b65bc5f8b7f0341a31faac44d69ba

See more details on using hashes here.

Provenance

File details

Details for the file bayeux_ml-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: bayeux_ml-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for bayeux_ml-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 630af2240d819a3a4a1181ddd6852afbf99ba929742b76b43dac2a1c1a8e023a
MD5 3a8bba27f6820880f5851d71aa3ee5bf
BLAKE2b-256 fdae8fab0823e7c6f8fa4464300c766cd8946d15d55d1eddf78c376a4904c82e

See more details on using hashes here.

Provenance

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