Practice track
Deep learning core
Losses, backpropagation, normalization and optimizers. 13 problems, about 375 minutes. Do them in order: each problem uses ideas from the problems before it.
- 01Inverted dropout
Inverted dropout with a given random generator: training forward with an exact mask, backward with the same mask, identity at inference.
From Regularization
ImplementEasy15 min - 02Focal loss
Binary and multi-class focal loss with gamma and alpha, from logits and without overflow, plus the binary gradient.
From Loss Functions
ResearchEasy20 min - 03Stable softmax and cross-entropy
Batched softmax, mean cross-entropy and its gradient, without overflow for large logits.
From Loss Functions
ImplementEasy20 min - 04Train a 2-4-1 network on XOR
Train a small sigmoid network with full-batch gradient descent until it labels noisy XOR points with 95 percent held-out accuracy.
TrainEasy30 min - 05LayerNorm and RMSNorm
LayerNorm with gamma and beta and RMSNorm with a weight, both over the last axis, with eps inside the square root.
ImplementEasy15 min - 06Adam and AdamW step
One Adam update with bias correction and a step counter that starts at 1, plus AdamW decoupled weight decay, as a pure function of the state.
From Optimizers
ImplementMedium25 min - 07Fit a sine curve with a tanh network
Train a 1-16-1 tanh network on noisy samples of sin(x) until its held-out mean squared error against the true curve is below 0.01.
From Activation Functions
TrainMedium35 min - 08Train a tanh network on two spirals
Train a 2-24-24-1 tanh network with mini-batch Adam until it separates two noisy spirals with 95 percent held-out accuracy.
TrainMedium45 min - 09CLIP symmetric contrastive loss
Normalize image and text embeddings, build the temperature-scaled similarity matrix, and compute the symmetric InfoNCE loss and its gradient.
ResearchMedium30 min - 10Rectified flow loss and Euler sampler
Interpolate along straight paths, regress the velocity x1 - x0 with the flow matching loss, and integrate a velocity field with Euler steps.
ResearchMedium25 min - 11DDPM noise schedule, closed form noising and posterior
Build the linear beta schedule and alpha bars, sample x_t from x_0 in closed form, and compute the mean and variance of q(x_{t-1} | x_t, x_0).
ResearchMedium30 min - 12Backpropagation through a two-layer MLP
Forward pass with a cache and a backward pass that returns the gradient of every weight and bias of a two-layer sigmoid network.
ImplementHard40 min - 13Batch normalization forward and backward
Training and inference forward passes with running statistics, and the full backward pass for x, gamma and beta.
From Regularization
ImplementHard45 min