Northeastern University · CS 7150 · Fall 2026
Interactive pieces for He et al. 2016 (ResNet) and Ioffe & Szegedy 2015 (batch normalization): first the puzzle, that deeper plain networks train worse; then why a shortcut fixes it, as learning zero instead of identity, as a gradient that survives depth, and as an ensemble of short paths; the blocks ResNets are built from; and then BatchNorm, step by step, why it helps, and which axes other normalizations use. Homework 2.1, tasks 3.13–3.18, builds these same pieces.
Eight networks train live on two spirals: plain and residual, 8 to 56 layers, all with BatchNorm. The deep plain ones end with higher training error than the shallow ones, so it is not overfitting; the residual ones fit at every depth. Turn BatchNorm off to see why ResNets need their branches to start small.
Open the explainer →The same random weights wired as a plain block and as a residual block, each drawn as a warp of the plane. The plain block has to be taught to copy its input; the residual block copies it once F is zero, and weight decay alone sends it there while it sends the plain block to the zero map. Then thirty blocks stacked on two spirals: a smooth flow, or a collapse.
Open the explainer →Plain and residual networks with the same random weights: backprop multiplies Jacobians, J·J···J against (I+J)···(I+J). Slide the weight scale and the plain gradient tilts geometrically unless the scale is just right; the residual one stays near 1, as long as each branch is normalized or scaled down. Plus the singular values of one layer.
Open the explainer →Unroll n residual blocks and they become 2n paths of every length. Most paths are medium length, but each block a path passes through weakens its gradient, so the gradient flows mostly through short ones: measured on a random net, and matching Veit et al.’s 5–17 of 54 blocks. Delete a block and a residual stack loses one block’s share; a plain stack loses its only path.
Open the explainer →The additive path an LSTM carries through time and a ResNet carries through depth. A plain layer multiplies the gradient by its gain every step, an LSTM cell or highway layer by its gate, and a residual shortcut by exactly one: ResNet is a highway that is always open.
Open the explainer →The residual representation He et al. cite: descriptors assigned to visual words, each word keeping the sum of descriptor-minus-center. Two images with identical bag-of-words counts get different VLAD vectors.
Open the explainer →ResNet's two blocks with live weight and multiply-add counts: a 256-wide bottleneck costs about what a 64-wide basic block does. When a block halves the map and doubles the channels, the shortcut must change shape, by zero-padding or a 1×1 projection. Then the stages of ResNet-18, 34 and 50, with where their 11.7M, 21.8M and 25.6M parameters sit. (The whole of ResNet-18 is also a preset in how big is the output?)
Open the explainer →Drag the examples of a minibatch and watch each feature be normalized by the batch's mean and spread, then scaled by γ and shifted by β; moving one example moves them all. Then the running averages used at test time, what goes wrong with tiny or unshuffled batches, and how BatchNorm folds into the layer before it.
Open the explainer →One sigmoid network trained twice side by side, plain and batch-normalized. Watch a hidden unit's input drift by many times its own width without BatchNorm and hold still with it; sweep the learning rate and see the range that trains widen from a factor of 2 to a factor of about 180; and scale a normalized layer's weights to see the loss not move while the gradient shrinks like 1/‖W‖, which is why weight decay matters there.
Open the explainer →A batch of activations drawn as a block of cells, N examples by C channels by positions. Pick BatchNorm, LayerNorm, InstanceNorm, GroupNorm, or the per-token LayerNorm and RMSNorm that transformers use, and click any cell: the cells that share its statistics light up, with the numbers. Only BatchNorm depends on the rest of the batch; and why modern transformers put the norm inside the residual branch (pre-norm).
Open the explainer →