Northeastern University · CS 7150

Deep Learning class demos

Interactive visualizations and Jupyter notebooks used in lecture. Everything here lives in github.com/CS7150/classdemos — notebooks open straight into Colab, and the interactive pages run in the browser with nothing to install.

Interactive demos

Six explainers

Quiz 0, worked

An interactive explainer for each technical question on the starting-points quiz: the matrix–vector product, least squares, the chain rule, expectation and variance, Bayes rule, and what flexibility does to bias and variance.

Open the set →
Runs in your browser

Rosenblatt's perceptron

The update rule, the margin, and the mistake bound, shown side by side in data space and weight space. Step through a run, scrub forwards and back, or watch the worst case walk the corners of the region the proof still permits.

Open the demo →
One explainer so far

Backpropagation, explained

Type a PyTorch-style expression and watch autograd build its graph node by node, run the forward pass in topological order, then run loss.backward() one node at a time: the upstream gradient, each local gradient, and the downstream shares added into each input.

Open the set →
Review

Review topics

The mathematics the lectures lean on, worked interactively. First up: backprop through y = Ax, where the gradient deals its entries to the rows of A, the input gradient comes out as ATg, and the product rule on each wire gives the weight gradient g xT.

Open the set →
Six explainers

Optimizers, explained

Building up to Adam: momentum averaging out noisy gradients, the EMA and bias correction behind it (plus why the recurrence is exactly a geometric series), a single learning rate fighting an anisotropic bowl, the mean/RMS diagnostic, and why Adam's update is scale-invariant.

Open the set →
Nine explainers

Initialization, explained

Glorot & Bengio 2010: saturation on a single tanh, what bad initialization looks like while a real network trains, the chain rule behind vanishing gradients one neuron per layer, how tanh, sigmoid, softsign and relu differ, what variance is, where the n and the 1/3 in n·Var(W) = 1/3 come from, the standard vs. normalized uniform inits, and the forward vs. backward compromise.

Open the set →
Nine explainers

Convolutions, explained

LeCun et al. 1989: why pixel distance fails when a digit moves, Hubel and Wiesel’s oriented detector as a grid of weights, 1D and 2D convolution stepped by hand, convolution as a Toeplitz matrix of shared weights, equivariance and pooling (and how stride breaks them), output sizes through a stack of layers, receptive fields and padding through depth, and the 4D weight tensor.

Open the set →
Eight explainers

Training deep networks

He 2016 and Ioffe 2015: why deeper plain networks train worse, residual blocks as learning zero, gradients through depth, ResNets as ensembles of paths, basic and bottleneck blocks, and BatchNorm step by step, why it helps, and which axes other normalizations use.

Open the set →
Eight explainers

Losses and regularization

Softmax, cross-entropy and KL, and why cross-entropy beats squared error; then weight decay, dropout, train-with-noise (early stopping, augmentation), batch size and gradient noise, and capacity with double descent.

Open the set →
Two explainers

Language modeling

Elman 1990, trained live: a recurrent network’s error spikes where the next letter can’t be known, one-step training against backprop through time, and word categories from next-word prediction, with controls, the zog test, a probe, and an intervention.

Open the set →
Five explainers

Adversarial examples

Szegedy et al. 2014, run live on MNIST networks: backprop carried to the input, the search for a minimal adversarial change, crafted vs. random noise, transfer across networks and data, and units vs. random directions.

Open the set →
One explainer

Flow matching

In one dimension: drag a few Dirac targets and weight them. Each has its own conditional flow, and the lines all cross; their weighted average is the single smooth marginal field a network learns, whose trajectories never cross.

Open the set →
Six explainers

Reinforcement learning for language models

REINFORCE, baselines, GRPO and DPO, live on a language model small enough to see whole: 64 completions, every next-token distribution on screen, and the KL-regularized optimum drawn as the target they all aim at. Plus the optimum itself on a line (the reference tilted by ereward/β), RL as guidance for language models, and Bradley-Terry, the model that turns preferences into probabilities.

Open the set →

Guides

Annotated transcript

Using an AI agent to learn the perceptron algorithm

An AI agent can give you the convergence proof in a single prompt. Getting it to explain the proof so you actually understand it took a few hours, and this is what that looked like: twenty rounds of saying “I don’t understand”, with the figure at each stage and the reasoning behind each next question in the margin.

Read the transcript →

Notebooks

Single neurons and what they can separate

The perceptron, its learning rule, and the limits of one linear threshold unit.

XOR and the first hidden layer

What one layer cannot do, and what happens once you train two or more.

Training dynamics

Watching decision boundaries and loss surfaces move while a small network learns.

Backpropagation and loss functions

Derivatives by hand, and what different losses actually reward.

Convolution and vision

Convolution as a matrix, and the fully-connected versus convolutional comparison.

Large pretrained models

Poking at CLIP and Stable Diffusion, and building the sample data they run on.