Skip to main content

Assumed Density Filtering (ADF) Probabilistic Networks

Project description

Documentation Status CI Status Code Coverage Code Style: Black

keras-adf provides implementations for probabilistic Tensorflow/Keras neural network layers, which are based on assumed density filtering. Assumed density filtering (ADF) is a general concept from Bayesian inference, but in the case of feed-forward neural networks that we consider here it is a way to approximately propagate a random distribution through the neural network.

The layers in this package have the same names and arguments as their corresponding Keras version. We use Gaussian distributions for our ADF approximations, which are described by their means and (co-)variances. So unlike the standard Keras layers, each keras-adf layer takes two inputs and produces two outputs (one for the means and one for the (co-)variances).

keras-adf layers can be used exactly like the corresponding Keras layers within a Keras model. However, as mentioned above, ADF layers take two inputs and produce two outputs instead of one, so it is not possible to simply mix ADF and standard layers within the same model.

from tensorflow.keras import Input, Model
from kerasadf.layers import Dense

in_mean = Input((10,))
in_var = Input((10,))
out_mean, out_var  = Dense(10, activation="relu")([in_mean, in_var])
model = Model([in_mean, in_var], [out_mean, out_var])

The Overview and Examples sections of our documentation provide more realistic and complete examples.

Project Information

keras-adf is released under the MIT license, its documentation lives at Read the Docs, the code on GitHub, and the latest release can be found on PyPI. It’s tested on Python 2.7 and 3.4+.

If you’d like to contribute to keras-adf you’re most welcome. We have written a short guide to help you get you started!

Further Reading

Additional information on the algorithmic aspects of keras-adf can be found in the following works:

  • Jochen Gast, Stefan Roth, “Lightweight Probabilistic Deep Networks”, 2018

  • Jan Macdonald, Stephan Wäldchen, Sascha Hauch, Gitta Kutyniok, “A Rate-Distortion Framework for Explaining Neural Network Decisions”, 2019

Acknowledgments

During the setup of this project we were heavily influenced and inspired by the works of Hynek Schlawack and in particular his attrs package and blog posts on testing and packaing and deploying to PyPI. Thank you for sharing your experiences and insights.

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

keras-adf-19.1.0.tar.gz (38.1 kB view details)

Uploaded Source

Built Distribution

keras_adf-19.1.0-py2.py3-none-any.whl (18.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file keras-adf-19.1.0.tar.gz.

File metadata

  • Download URL: keras-adf-19.1.0.tar.gz
  • Upload date:
  • Size: 38.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191101 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for keras-adf-19.1.0.tar.gz
Algorithm Hash digest
SHA256 cfdd91fc7f37629a037a9bf0e0a792e8a553e22ac8b345e4f0dd6c55d8e56de6
MD5 14b70f4363a65a5c978e0db5d55cc897
BLAKE2b-256 557868f8426c0ea5368a343ea71e37894fa6809f7e4f54addf10dd74473a2998

See more details on using hashes here.

File details

Details for the file keras_adf-19.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: keras_adf-19.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191101 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for keras_adf-19.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 898afc18c67fd38e606c25fa5533524649bcb99233151a614047548b193f7894
MD5 2bc2672659ebc34ec78aefb79f649fec
BLAKE2b-256 beb743604a663daafc26a0ea1e98e941e08af0669cbf120808c0e2bf04036a22

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