Plotting with Seaborn

I find seaborn.objects much more pleasant to use that matplotlib or the default Seaborn interface. Therefore, some useful references:

Extensions I’ve found:

Questions I have:

  • how to take an average (like so.Agg()) over both x and y axes, and over specific columns? e.g. if I have multiple runs with different hyperparameters (columns C1,C2,C3) and different methods to compare (C4-…), how do I plot the maxima over C1-C3?
  • how to mix faceting and pairing not in the obvious way? e.g. facet on row="A" and ‘pair’ along the columns y=["B","C"], so that we get 2 different y axes in the same row (but ideally shared across rows)

JAX

Some collected useful things from writing JAX

Environment variables for debugging

JAX_DEBUG_NANS=1
JAX_DIABLE_JIT=1

Choosing gpus and platforms for JAX

(for CUDA in general)

CUDA_VISIBLE_DEVICES=3 # for gpu 3, 0-indexed

for JAX, if you don’t want to use GPU memory for a simple job that still needs a JAX import

JAX_PLATFORMS=      # blank for default/all
JAX_PLATFORMS=cpu   # just cpu

If you want to use tensorflow-datasets without tensorflow also using gpu space, make sure to install tensorflow-cpu specifically.

Useful refences from Oxford

These are some notes I wrote during my Maths & CS degree, and so may be varyingly useful or correct.

The summary sheets were a (sadly ?) shortlived part of examinations post-covid, as we could take 2 sides of A4 into the exam, which meant you could focus on learning/problem solving instead of memorisation. I’ve also linked to the original lecture notes written by the various professors, but since I don’t have permission to share them, they are private links for me only.

Course Term My Notes Summary sheet Lecture Notes
Prelims Probability MT19 Lecture notes
Part A Probability MT20 Lecture notes
Continuous Maths HT20 Summary Lecture notes
Integration HT21 My notes
Functional Analysis I MT21 My notes Summary Lecture notes
Probability, Measure and Martingales MT21 My notes Handwritten and Latex Lecture notes
Machine Learning MT21 My notes Folder
Functional Analysis II HT22 Summary Lecture notes
Applied Probability HT22 Summary Lecture notes
Information Theory HT22 Summary Lecture notes
Further Functional Analysis MT22 Lecture notes
Algorithmic Foundations of Learning MT22 My notes Lecture notes
Computational Learning Theory MT22 My notes Lecture notes
Probability and Computing MT22 My notes Lecture notes
Advanced Topics in Statistical Machine Learning HT23 My notes Lecture notes

Pandas and Jupyter Tips

Automatic reloading for Jupyter

%load_ext autoreload
%autoreload 2

Setting Pandas display options

To avoid truncation of long DataFrames, you can set the following options:

import pandas as pd
pd.set_option("display.expand_frame_repr", False)
pd.options.display.max_columns = None
pd.options.display.max_rows = None