Skip to main content

A framework for Bayesian Neural Nets

Project description

Introduction

Many successful pieces of software today involve machine learning, which is why many tools and libraries were created to make implementing machine learning models easier. The best examples are Tensorflow, PyTorch and Keras. We want good software to accelerate progress in ML. One area that has a lot of promise to accelerate progress is Bayesian deep learning.

Deterministic NNs seem to have many failure modes including discriminatory bias, poor uncertainty, and a lack of robustness. An important source of these is that the choice of the weights $\Omega$ of our neural network is often highly discriminating. $\Omega$ is often one local minimum among many others and does not encompass all the 'knowledge' needed to solve tasks. For instance, in a classification problem the choice of a particular $\Omega$ does not encode the uncertainty in the predictions being made. As long as our input point $x$ is 'far enough' from the decision boundary, the NN will predict class A with high probability, even if no data points exist around our input $x$. This can be seen on the illustrative plot below.

An alternative that can potentially remedy the aforementioned failure modes is Bayesian learning. Bayesian machine learning involves inferring a posterior distribution $p(\Omega|D)$ over model parameters via Bayes rule given the dataset $D$: $$p(\Omega|D) = \frac{p(D|\Omega)p(\Omega)}{\int p(D|\Omega)p(\Omega)d\Omega}$$ This rule has a prior $p(\Omega)$ which expresses prior knowledge and has been shown to have nice trustworthiness properties. Though extremely valuable to have, one cannot compute the exact posterior. Thus, approximate inference methods have been proposed. These diverse approaches to Bayesian inference, especially for deep learning, have not been united in a way that would enable Bayesian ML to have the same acceleration we have observed for deterministic ML.

There exists many inference methods to approximate posterior distribution (HMC, SGLD, SWAG, BBB...), each with its pros and cons (runtime, accuracy of approximation...).

Our library builds on top of Tensorflow Keras © to make the training of Bayesian Neural Networks simple. It groups together a wide range of inference methods in one easy-to-use framework to enable Bayes in ordinary NNs with minimum efforts on the user-side as well as many other features listed below.

Inference Methods implemented

  • SWAG
  • Bayes by Backprop (BBB)
  • SGLD
  • HMC
  • SGD
  • SGLD
  • ADAM
  • VADAM
  • BSAM

External libraries integrated

  • Support to all Kersa models architectures
  • Support to all Tensorflow probability distributions
  • Support to Weights and Biases
  • Support to OpenAi Gym RL envirenment
  • Tensorflow datasets easy loading

References

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

pyesian-0.0.1.tar.gz (42.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyesian-0.0.1-py3-none-any.whl (65.9 kB view details)

Uploaded Python 3

File details

Details for the file pyesian-0.0.1.tar.gz.

File metadata

  • Download URL: pyesian-0.0.1.tar.gz
  • Upload date:
  • Size: 42.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.9

File hashes

Hashes for pyesian-0.0.1.tar.gz
Algorithm Hash digest
SHA256 31b6852da47db40e9ec3ba12133dbdeb174ac01d2ba33236ccecaf4098fb9921
MD5 433518574ba27e1a2da295b1a43f3be2
BLAKE2b-256 09b8695953b34ad9c4dbc9dbb2b20f7f93431f236dce17cbd11a4d8d558f6cad

See more details on using hashes here.

File details

Details for the file pyesian-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyesian-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 65.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.9

File hashes

Hashes for pyesian-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd93fa50da434f56339e7063631cac6b8a94ff37e5fd7466c3670d99a265097a
MD5 9a157333ddbfa3a60801576761be988d
BLAKE2b-256 c5cc9af0db82dc7cacbd5fff668144c64bdcab16a40fd349fc1fa1c7bf46cf95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page