StatBiomed / TensorFlow-Bayes

Examples of TensorFlow for Bayesian inference

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tutorial and learning for automated Variational Bayes

In the repository, we implemeted a few common Bayesian models with TensorFlow and TensorFlow Probability, most with variational inference. We also aim to provide detailed examples on these implemented models.

Settings

We recommend using conda to set a separate environment for installing all necessary dependent packages, which you could use the following commond lines to create an environment TFProb for the dependent packages:

conda create -n TFProb python=3.7 scipy numpy matplotlib scikit-learn tensorflow=2.0.0

Note, tensorflow-probability v0.8.0 is not available on conda yet, you could install it from PyPI:

conda activate TFProb
pip install tensorflow-probability==0.8.0

Also, you could add the newly created environment TFProb into IPython kernel. (make sure you have ipykernel).

conda activate TFProb
conda install ipykernel
python -m ipykernel install --user --name TFProb --display-name "TFProb"

To activate the created environment, use conda activate TFProb

Notes

  • MacBook fails to work with both tf.tensordot and np.tensordot (or np.dot), while Linux works fine. See the reported issue.
  • Many of the functions should be implemeted with PyTorch too, which is under testing.

About

Examples of TensorFlow for Bayesian inference

License:Apache License 2.0


Languages

Language:Python 100.0%