Skip to main content

Uncertainty quantification library in PyTorch

Project description

TorchUncertaintyLogo

pypi tests Docs PRWelcome Ruff Code Coverage Discord Badge

TorchUncertainty is a package designed to help you leverage uncertainty quantification techniques and make your deep neural networks more reliable. It aims at being collaborative and including as many methods as possible, so reach out to add yours!

:construction: TorchUncertainty is in early development :construction: - expect changes, but reach out and contribute if you are interested in the project! Please raise an issue if you have any bugs or difficulties and join the discord server.

Our webpage and documentation is available here: torch-uncertainty.github.io.


This package provides a multi-level API, including:

  • easy-to-use ⚡️ lightning uncertainty-aware training & evaluation routines for 4 tasks: classification, probabilistic and pointwise regression, and segmentation.
  • ready-to-train baselines on research datasets, such as ImageNet and CIFAR
  • pretrained weights for these baselines on ImageNet and CIFAR (work in progress 🚧).
  • layers, models, metrics, & losses available for use in your networks
  • scikit-learn style post-processing methods such as Temperature Scaling.

Have a look at the Reference page or the API reference for a more exhaustive list of the implemented methods, datasets, metrics, etc.

⚙️ Installation

TorchUncertainty requires Python 3.10 or greater. Install the desired PyTorch version in your environment. Then, install the package from PyPI:

pip install torch-uncertainty

The installation procedure for contributors is different: have a look at the contribution page.

:racehorse: Quickstart

We make a quickstart available at torch-uncertainty.github.io/quickstart.

:books: Implemented methods

TorchUncertainty currently supports Classification, probabilistic and pointwise Regression and Segmentation.

Baselines

To date, the following deep learning baselines have been implemented:

  • Deep Ensembles
  • MC-Dropout - Tutorial
  • BatchEnsemble
  • Masksembles
  • MIMO
  • Packed-Ensembles (see Blog post) - Tutorial
  • Bayesian Neural Networks :construction: Work in progress :construction: - Tutorial
  • Regression with Beta Gaussian NLL Loss
  • Deep Evidential Classification & Regression - Tutorial

Augmentation methods

The following data augmentation methods have been implemented:

  • Mixup, MixupIO, RegMixup, WarpingMixup

Post-processing methods

To date, the following post-processing methods have been implemented:

  • Temperature, Vector, & Matrix scaling - Tutorial
  • Monte Carlo Batch Normalization - Tutorial

Tutorials

Our documentation contains the following tutorials:

Other References

This package also contains the official implementation of Packed-Ensembles.

If you find the corresponding models interesting, please consider citing our paper:

@inproceedings{laurent2023packed,
    title={Packed-Ensembles for Efficient Uncertainty Estimation},
    author={Laurent, Olivier and Lafage, Adrien and Tartaglione, Enzo and Daniel, Geoffrey and Martinez, Jean-Marc and Bursuc, Andrei and Franchi, Gianni},
    booktitle={ICLR},
    year={2023}
}

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

torch_uncertainty-0.2.0.tar.gz (698.1 kB view details)

Uploaded Source

Built Distribution

torch_uncertainty-0.2.0-py3-none-any.whl (194.0 kB view details)

Uploaded Python 3

File details

Details for the file torch_uncertainty-0.2.0.tar.gz.

File metadata

  • Download URL: torch_uncertainty-0.2.0.tar.gz
  • Upload date:
  • Size: 698.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for torch_uncertainty-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dc01ceb00327c0bb60f6e650288c13c12685ea0b90939d259c15735b1a936f66
MD5 0ad3df093ab48f4fcb2aa18ae8326e23
BLAKE2b-256 604d83d92ce581ce0d362f74dfda7fffa0c0f5135da71c5c12a9c971a1d580e8

See more details on using hashes here.

File details

Details for the file torch_uncertainty-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_uncertainty-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb52123bb7c043327d129a8738fc492beb2d08aefdbd801d10a44828781c9bb9
MD5 54dfe2a37b4f593f2ac1764dc9497699
BLAKE2b-256 735217c346daf6cdb67fe8e6830e87c8bb4dab716143ffd663a29fe5588d028c

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