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.

0 / 13 solved

  1. 01
    Inverted 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
  2. 02
    Focal 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
  3. 03
    Stable softmax and cross-entropy

    Batched softmax, mean cross-entropy and its gradient, without overflow for large logits.

    From Loss Functions

    ImplementEasy20 min
  4. 04
    Train 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.

    From Backpropagation from Scratch

    TrainEasy30 min
  5. 05
    LayerNorm and RMSNorm

    LayerNorm with gamma and beta and RMSNorm with a weight, both over the last axis, with eps inside the square root.

    From The Full Transformer — Encoder + Decoder

    ImplementEasy15 min
  6. 06
    Adam 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
  7. 07
    Fit 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
  8. 08
    Train 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.

    From Build Your Own Mini Framework

    TrainMedium45 min
  9. 09
    CLIP symmetric contrastive loss

    Normalize image and text embeddings, build the temperature-scaled similarity matrix, and compute the symmetric InfoNCE loss and its gradient.

    From Open-Vocabulary Vision — CLIP

    ResearchMedium30 min
  10. 10
    Rectified 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.

    From Flow Matching & Rectified Flows

    ResearchMedium25 min
  11. 11
    DDPM 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).

    From Diffusion Models — DDPM from Scratch

    ResearchMedium30 min
  12. 12
    Backpropagation 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.

    From Backpropagation from Scratch

    ImplementHard40 min
  13. 13
    Batch 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