Python 3 code to reproduce the figures in the book series Probabilistic Machine Learning by Kevin Patrick Murphy. This is work in progress, so expect rough edges! (Some demos use code from our companion JAX State Space Library.)
The notebooks needed to make all the figures are available at the following locations.
- Volume 1 figure notebooks
- Volume 2 figure notebooks. (Note: volume 2 is not finished yet.)
Notebooks are saved in chapter-wise folders. For example, a notebook for figure 2.3 is saved in the folder notebooks/book1/02/
.
In addition to the figure notebooks, there are a series of notebooks which provide supplementary material for the book. These are stored in the misc
folder.
Colab has most of the libraries you will need (e.g., scikit-learn, JAX) pre-installed, and gives you access to a free GPU and TPU. We have a created a
colab intro
notebook with more details. To run the notebooks on colab in any browser, you can go to a particular notebook on GitHub and change the domain from github.com
to githubtocolab.com
as suggeted here. If you are using Google Chrome browser, you can use "Open in Colab" Chrome extension to do the same with a single click.
We assume you have already installed JAX and Tensorflow and Torch, since the details on how to do this depend on whether you have a CPU, GPU, etc.
You can use any of the following options to install the other requirements.
- Option 1
pip install -r https://raw.githubusercontent.com/probml/pyprobml/master/requirements.txt
- Option 2
Download requirements.txt locally to your path and run
pip install -r requirements.txt
When you want more power or control than colab gives you, you should get a Google Cloud Platform (GCP) account, and get access to a TPU VM. You can then use this as a virtual desktop which you can access via ssh from inside VScode. We have created various tutorials on Colab, GCP and TPUs with more information.
See this guide for how to contribute code. Please follow these guidelines to contribute new notebooks to the notebooks directory.
For a summary of some of the contributions to this codebase during Google Summer of Code (GSOC) 2021, see this link. Stay tuned for GSOC 2022.
I would like to thank the following people for contributing to the code (list autogenerated from this page):