TyXe: Pyro-based Bayesian neural nets for Pytorch

Hippolyt Ritter, Theofanis Karaletsos
10/1/2021
stat.MLcs.LG
bayesian

Official code: TyXe-BDL/TyXe (159 stars, Jupyter Notebook, MIT, last commit 2022-09-15).

Abstract

We introduce TyXe, a Bayesian neural network library built on top of Pytorch and Pyro. Our leading design principle is to cleanly separate architecture, prior, inference and likelihood specification, allowing for a flexible workflow where users can quickly iterate over combinations of these components.

Show full abstract

In contrast to existing packages TyXe does not implement any layer classes, and instead relies on architectures defined in generic Pytorch code. TyXe then provides modular choices for canonical priors, variational guides, inference techniques, and layer selections for a Bayesian treatment of the specified architecture. Sampling tricks for variance reduction, such as local reparameterization or flipout, are implemented as effect handlers, which can be applied independently of other specifications. We showcase the ease of use of TyXe to explore Bayesian versions of popular models from various libraries: toy regression with a pure Pytorch neural network; large-scale image classification with torchvision ResNets; graph neural networks based on DGL; and Neural Radiance Fields built on top of Pytorch3D. Finally, we provide convenient abstractions for variational continual learning. In all cases the change from a deterministic to a Bayesian neural network comes with minimal modifications to existing code, offering a broad range of researchers and practitioners alike practical access to uncertainty estimation techniques. The library is available at https://github.com/TyXe-BDL/TyXe.

View on arXivView PDF

Code Implementations(1)

TyXe-BDL/TyXeOfficial100%
MIT
15933Jupyter Notebook, PythonMar 15, 20214 years agoMIT

Similar Papers

Cite this paper

@article{ritter2021tyxe,
  title  = {TyXe: Pyro-based Bayesian neural nets for Pytorch},
  author = {Hippolyt Ritter and Theofanis Karaletsos},
  year   = {2021},
  eprint = {2110.00276},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2110.00276}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2110.00276.svg)](https://codeofpaper.com/paper/2110.00276)

Discussion