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.1.tar.gz (42.8 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.1-py3-none-any.whl (65.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyesian-0.0.1.1.tar.gz
  • Upload date:
  • Size: 42.8 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.1.tar.gz
Algorithm Hash digest
SHA256 7fb478e6ae471220d6d779550711bcceed3dd749b2e7f121f6516432a3acb9a1
MD5 9d61acb559563fb47f323536eb59dce8
BLAKE2b-256 0effd595941f3caa924614598adb63236ad253b0e77e6981bd1aca936c94780c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyesian-0.0.1.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2aaa1de7a4eda03a39d0c5b09614603c18ed1efbb92ea74690070820a536844
MD5 93e001429b70ceaaf76987539892b067
BLAKE2b-256 df4ee591403b53de39a78701bc87eeee50fc763f260e1d176489238951aeba1b

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