Skip to content

Instantly share code, notes, and snippets.

# Makefile to create arxiv submission conforming single latex files. Created originaly by Uwe Schmidt
all: pdf
pdf: main.tex
pdflatex main.tex
# http://stackoverflow.com/a/21935690
-biber main
pdflatex main.tex
@maweigert
maweigert / coin_flip.py
Created March 19, 2024 16:46
coin flipping
"""
Flip a fair coin 100 times—it gives a sequence of heads (H) and tails (T).
For each HH in the sequence of flips, Alice gets a point; for each HT, Bob does,
so e.g. for the sequence THHHT Alice gets 2 points and Bob gets 1 point.
Who is most likely to win?
https://x.com/littmath/status/1769044719034647001?s=20
@maweigert
maweigert / mlp_viz.py
Created April 1, 2025 09:37
MLP decision boundary viz
"""
Plots the decision boundary and the loss as a function of training time/epochs
for perceptron (no hidden layer) or single hidden layer MLP for difefrent datasets ('moons', 'blobs', 'xor')
requires:
pip install torch torchvision torchaudio matplotlib tqdm seaborn moviepy scipy scikit-learn