normal-computing/posteriors
Uncertainty quantification with PyTorch
What it solves
It provides a general-purpose Python library for uncertainty quantification (UQ) in machine learning models, allowing developers to understand how confident a model is about its predictions rather than just providing a single point estimate.
How it works
The library uses a functional approach based on PyTorch and torch.func, enabling it to be composable and scalable. Users define a log_posterior function and a temperature setting, and then apply a transform to the model parameters. It supports several Bayesian learning methods to estimate the posterior distribution of model weights, including:
- Variational Inference (VI)
- Laplace Approximation
- Stochastic Gradient MCMC (SGMCMC)
- Extended Kalman Filter (EKF)
Who it’s for
It is designed for researchers and developers working with PyTorch models who need to implement Bayesian learning and uncertainty quantification, particularly those using the Hugging Face transformers library or PyTorch Lightning.
Highlights
- Composable: Works seamlessly with
transformers,lightning,torchopt, andpyro. - Functional Design: Closer to mathematical definitions and easier to test.
- Scalable: Designed to handle large models and large datasets.
- Swappable Algorithms: Allows users to switch between different UQ methods with minimal code changes.
Related
- Project
- Project
- Project
- Project