Skip to main content

Lighning-UQ-Box: A toolbox for uncertainty quantification in deep learning

Project description

Lightning-UQ-Box logo

docs style tests codecov

lightning-uq-box

The lightning-uq-box is a PyTorch library that provides various Uncertainty Quantification (UQ) techniques for modern neural network architectures.

We hope to provide the starting point for a collaborative open source effort to make it easier for practitioners to include UQ in their workflows and remove possible barriers of entry. Additionally, we hope this can be a pathway to more easily compare methods across UQ frameworks and potentially enhance the development of new UQ methods for neural networks.

The project is currently under active development, but we nevertheless hope for early feedback, feature requests, or contributions. Please check the Contribution Guide for further information.

The goal of this library is threefold:

  1. Provide implementations for a variety of Uncertainty Quantification methods for Modern Deep Neural Networks that work with a range of neural network architectures and have different theoretical underpinnings
  2. Make it easy to compare UQ methods on a given dataset
  3. Focus on reproducibility of experiments with minimum boiler plate code and standardized evaluation protocols

To this end, each UQ-Method is essentially just a Lightning Module which can be used with a Lightning Data Module and a Trainer to execute training, evaluation and inference for your desired task. The library also utilizes the Lightning Command Line Interface (CLI) for better reproducibility of experiments and setting up experiments at scale.

Installation

$ pip install lightning-uq-box

UQ-Methods

In the tables that follow below, you can see what UQ-Method/Task combination is currently supported by the Lightning-UQ-Box via these indicators:

  • ✅ supported
  • ❌ not designed for this task
  • ⏳ in progress

The implemented methods are of course not exhaustive, as the number of new methods keeps increasing. For an overview of methods that we are tracking or are planning to support, take a look at this issue.

Classification of UQ-Methods

The following sections aims to give an overview of different UQ-Methods by grouping them according to some commonalities. We agree that there could be other groupings as well and welcome suggestions to improve this overview. We also follow this grouping for the API documentation in the hopes to make navigation easier.

Single Forward Pass Methods

Uncertainty Quantification Method (UQ-Method) Regression Classification Segmentation Pixel Wise Regression
Quantile Regression (QR)
Deep Evidential (DE)
Mean Variance Estimation (MVE)

Approximate Bayesian Methods

Uncertainty Quantification Method (UQ-Method) Regression Classification Segmentation Pixel Wise Regression
Bayesian Neural Network VI ELBO (BNN_VI_ELBO)
Bayesian Neural Network VI (BNN_VI)
Deep Kernel Learning (DKL)
Deterministic Uncertainty Estimation (DUE)
Laplace Approximation (Laplace)
Monte Carlo Dropout (MC-Dropout)
Stochastic Gradient Langevin Dynamics (SGLD)
Spectral Normalized Gaussian Process (SNGP)
Stochastic Weight Averaging Gaussian (SWAG)
Deep Ensemble

Generative Models

Uncertainty Quantification Method (UQ-Method) Regression Classification Segmentation Pixel Wise Regression
Classification And Regression Diffusion (CARD)
Probabilistic UNet
Hierarchical Probabilistic UNet

Post-Hoc methods

Uncertainty Quantification Method (UQ-Method) Regression Classification Segmentation Pixel Wise Regression
Test Time Augmentation (TTA)
Temperature Scaling
Conformal Quantile Regression (Conformal QR)
Regularized Adaptive Prediction Sets (RAPS)

Tutorials

We try to provide many different tutorials so that users can get a better understanding of implemented methods and get a feel for how they apply to different problems. Head over to the tutorials page to get started. These tutorials can also be launched in google colab if you navigate to the rocket icon at the top of a tutorial page.

Documentation

We aim to provide an extensive documentation on all included UQ-methods that provide some theoretical background, as well as tutorials that illustrate these methods on toy datasets.

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

lightning-uq-box-0.1.0.tar.gz (117.7 kB view details)

Uploaded Source

Built Distribution

lightning_uq_box-0.1.0-py3-none-any.whl (162.2 kB view details)

Uploaded Python 3

File details

Details for the file lightning-uq-box-0.1.0.tar.gz.

File metadata

  • Download URL: lightning-uq-box-0.1.0.tar.gz
  • Upload date:
  • Size: 117.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.12

File hashes

Hashes for lightning-uq-box-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ce44860db75b4fbe487a009bee91c886be2e1835edee93479a6a8633ef2152b1
MD5 1a05c579e97b15064612bd2afb2ec7b7
BLAKE2b-256 6a238fddc84f44236d6c5ed57bd54ccca39dab5361db6ff61921762157fd1ba7

See more details on using hashes here.

File details

Details for the file lightning_uq_box-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lightning_uq_box-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5fdb42d31b1d36f32da6000212d6d2df7127bfd3db20750fa7879355fd16fcb
MD5 908da53f038df1f702def0fe3547963a
BLAKE2b-256 c3293182cabe672cd007d011bf5b863a286cbd395e041de60404149d901e6f5a

See more details on using hashes here.

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