Prof. Gabe’s Teaching Demos
Interactive demos for lectureWelcome! This page collects the interactive demos I use in my courses on machine learning, AI and statistics (and occasionally when presenting my research). It's a living collection that will likely grow and be refined over time. My own notes on neural networks are available here.
Please note that this site is:
- Not a textbook. The demos are designed to be presented by someone who already understands the underlying concepts, not as stand-alone tutorials.
- Not an engineering showcase. Most were built with substantial help from agentic coding tools (Claude Code and Codex). They replace my earlier collection of hand-implemented visualizations, which is no longer maintained.
- Best in Chrome. Most demos run on WebGPU and are developed and tested in Chromium-based browsers (Chrome, Edge, Arc, Brave). In others, some may run slowly or not at all.
If you're curious how the neural network visualizations keep up in real time, check out my prototype visualization library HMPlot, which is built on top of jax-js and Threlte.
Neural networks
Network playground Build and train a small network on 2-D or tabular data. Requires WebGPU
CNN playground Build and train a convolutional network on small images. Requires WebGPU
Pretrained CNN Predictions, Grad-CAM and input optimization for ImageNet models. Requires WebGPU
Fine-tuning Collect examples, fine-tune a CNN, test on new images. Requires WebGPU
Convolution Kernels sliding over images; detectors; AlexNet first-layer filters.
1-D diffusion Diffusion on one-dimensional distributions, with sample traces. Requires WebGPU
2-D diffusion Train, sample, trace and inpaint on 2-D point clouds. Requires WebGPU
Image diffusion A small diffusion model on MNIST, CIFAR-10 and sketches. Requires WebGPUStatistics and optimization
Optimization Compare optimizers on 2-D test functions. Requires WebGPU
Linear regression Fitting as optimization: parameter space beside data space. Requires WebGPU
Logistic regression A sigmoid classifier fit by descending its loss over (w, b). Requires WebGPU
PCA The principal direction as the best-fit line over angle and offset. Requires WebGPU
Bootstrapping Nonparametric and parametric bootstrap from one observed sample.
Mixtures Gaussian mixtures fit by EM or gradient descent. Requires WebGPUPerceptrons
Perceptron catch game A perceptron learns where the ball will land.
Play the catch game Make the calls yourself, then see the data.
Ballistic perceptron Launch angle and speed decide the catch.
Ballistic neural network A hidden layer bends the decision boundary.
Fixed dataset Training and test points from a fixed sample. Reinforcement learning
Drive the cart Catch the ball yourself with the arrow keys.
V-table gridworld Value iteration on a small grid.
Q-table gridworld Tabular Q-learning, one update at a time.
Q-network gridworld A network replaces the Q-table.
Continuous gridworld Q-learning with continuous positions.
Policy gradient gridworld REINFORCE on the grid.
Continuous policy gradient REINFORCE with continuous positions.
Q-learning cart A Q-network learns to catch.
Policy gradient cart REINFORCE learns to catch.
GRPO cart Group-relative policy optimization.
PPO cart Clipped policy updates with a critic.
Model-based cart Learn the dynamics, then plan.
Genetic algorithm cart Evolve the policy network.
Imitate me Drive, and a network learns from you.