Package: pyprobml
pyprobmlPython 3 code to reproduce the figures in the book seriesProbabilistic Machine Learningby Kevin Patrick Murphy.
This is work in progress, so expect rough edges!
(Some demos use code from our companionJAX State Space Library.)Running the notebooksThe scripts needed to make all the figures for each chapter are automatically combined together into a series of Jupyter notebooks, one per chapter.Volume 1 figure notebooksVolume 2 figure notebooks. (Note: volume 2 is not finished yet.)In addition to the automatically generated notebooks, there are a series of manually created notebooks, which create additional figures, and provide supplementary material for the book. These are stored in thenotebooks repo, since they can be quite large. Some of these notebooks use the scripts mentioned above, but others are independent of the book content.The easiest way to run these notebooks is insideColab. This 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 aintro to colabnotebook with more details.Running scripts in colabThe easiest way to run individual scripts is insideColab.
Just cut and paste this into a code cell:pip install superimport 
git clone --depth 1 https://github.com/probml/pyprobml  &> /dev/null # THIS CODEBASENote: Thesuperimportlibrary will automatically install packages for any file which contains the line `import superimport'.Then run a script from a cell like this:%run pyprobml/scripts/softmax_plot.pyTo edit a file locally and then run it, follow the example below.# Make sure local changes to file are detected by runtime
%load_ext autoreload
%autoreload 2

file = 'pyprobml/scripts/softmax_plot.py' # change this filename as needed
from google.colab import files
files.view(file) # open editor

%run $fileTo download and run code from github, follow the example below.
(Note therawin the URL.)!wget -q https://raw.githubusercontent.com/probml/pyprobml/master/scripts/softmax_plot.py
%run softmax_plot.pyRunning the scripts locallyWe assume you have already installedJAXandTensorflowandTorch,
since the details on how to do this depend on whether you have a CPU, GPU, etc.For the remaining python packages, do this:pip install superimport 
git clone --depth 1 https://github.com/probml/pyprobml  &> /dev/null # THIS CODEBASENote: Thesuperimportlibrary will automatically install packages for any file which contains the line `import superimport'.To manually execute an individual script from the command line,
follow this example:python3 pyprobml/scripts/softmax_plot.pyThis will  run the script, plot a figure, and save the result to thepyprobml/figuresdirectory.Running scripts for vol 2Some demos for vol 2 useJSL (Jax State-space Library).
This requires extra packages, seethese installation instructions.
Then you can run the pyprobml version of the JSL demos like this%run pyprobml/scripts/kf_tracking_demo.py # colab
python3 pyprobml/scripts/kf_tracking_demo.py # locallyGCP, TPUs, and all thatWhen 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 createdvarious tutorials on Colab, GCP and TPUswith more information.How to contributeSeethis guidefor how to contribute code.MetricsGSOC 2021For a summary of some of the contributions to this codebase during Google Summer of Code 2021,
seethis link.AcknowledgementsI would like to thank the following people for contributing to the code
(list autogenerated fromthis page):murphykmjsMLDrishttiiDuane321gerdmanimesh-007Nirzu97always-newbie161karalleynanappaillavjdf22shivaditya-meduriNeoanarikaandrewncAbdelrahman350Garvit9000ckzymgchalen1010adamnemecekgalvkrassermnealmcbpetercernoPrahithakhanshehjadhieuzajlh2018mvervuurtTripleTop