• Stars
    star
    6,499
  • Rank 6,101 (Top 0.2 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created about 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python code for "Probabilistic Machine learning" book by Kevin Murphy

pyprobml

Python 3 code to reproduce the figures in the books Probabilistic Machine Learning: An Introduction (aka "book 1") and Probabilistic Machine Learning: Advanced Topics (aka "book 2"). The code uses the standard Python libraries, such as numpy, scipy, matplotlib, sklearn, etc. Some of the code (especially in book 2) also uses JAX, and in some parts of book 1, we also use Tensorflow 2 and a little bit of Torch. See also probml-utils for some utility code that is shared across multiple notebooks.

For the latest status of the code, see Book 1 dashboard and Book 2 dashboard. As of September 2022, this code is now in maintenance mode.

Running the notebooks

The notebooks needed to make all the figures are available at the following locations.

Running notebooks in colab

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 suggested here. If you are using Google Chrome browser, you can use "Open in Colab" Chrome extension to do the same with a single click.

Running the notebooks locally

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
  • Option 3

Run

git clone --depth 1 https://github.com/probml/pyprobml.git

Then install manually.

GCP, TPUs, and all that

When you want more power or control than colab gives you, you should get a Google Cloud Platform (GCP) account (or you can use some other cloud provider, like Paperspace) to get a virtual machine with GPUs or TPUs. You can then use this as a virtual desktop which you can access via ssh from inside VScode. We have created a short tutorial on Colab, GCP and TPUs with more information.

How to contribute

See this guide for how to contribute code. Please follow these guidelines to contribute new notebooks to the notebooks directory.

Metrics

Stargazers over time

GSOC

For a summary of some of the contributions to this codebase during Google Summer of Code (GSOC), see these links: 2021 and 2022.

Acknowledgements

For a list of contributors, see this list.

More Repositories

1

pml-book

"Probabilistic Machine Learning" - a book series by Kevin Murphy
Jupyter Notebook
4,932
star
2

pmtk3

Probabilistic Modeling Toolkit for Matlab/Octave.
HTML
1,546
star
3

pml2-book

Probabilistic Machine Learning: Advanced Topics
1,389
star
4

dynamax

State Space Models library in JAX
Python
675
star
5

probml-notebooks

Notebooks for "Probabilistic Machine Learning" book
Jupyter Notebook
202
star
6

sts-jax

Structural Time Series in JAX
Jupyter Notebook
182
star
7

ssm-book

Interactive textbook on state-space models
Jupyter Notebook
172
star
8

bandits

Bayesian Bandits
Jupyter Notebook
64
star
9

rebayes

Recursive Bayesian Estimation (Sequential / Online Inference)
Jupyter Notebook
57
star
10

pmtkdata

A collection of MATLAB data sets used by PMTK.
MATLAB
57
star
11

pmtksupport

Various packages used by PMTK.
MATLAB
54
star
12

JSL

Jax SSM Library
Python
51
star
13

jprobml

Julia code for Probabilistic Machine Learning
Julia
37
star
14

probml-utils

Utilities for probabilistic ML
Python
32
star
15

probml-data

Datasets associated with pyprobml
Jupyter Notebook
19
star
16

pgm-jax

Probabilistic Graphical Models in JAX
Jupyter Notebook
14
star
17

pmtk1

A probabilistic modeling toolkit for Matlab/Octave. (Deprecated/old version.)
MATLAB
9
star
18

shift-happens

Research code for ML with distribution shift
Jupyter Notebook
8
star
19

superimport

Simple package to lookup missing packages and autoinstall them.
Python
7
star
20

sequential-neural-testbed

Sequential neural testbed
Jupyter Notebook
7
star
21

shifty

Distribution Shift
Jupyter Notebook
6
star
22

covid19

Covid19 modeling experiments
Jupyter Notebook
5
star
23

pmtk2

A probabilistic modeling toolkit for Matlab/Octave. (Deprecated/old version.)
MATLAB
4
star
24

deimport

Python
4
star
25

colab_powertoys

A set of python functions that enhances your experience with Google's Colab (Not a Google Project)
Python
4
star
26

probml.github.io

HTML
4
star
27

chest_xray_kaggle

derived from https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia
3
star
28

gan-zoo

Generative Adversarial Networks for images
1
star
29

bic

Python
1
star
30

vae-zoo

Variational Autoencoders for images
1
star