← Contents Volume IV · Lecture 10

Volume IV · Making Training Actually Work

10

Starting From the Right Place

Before a single training step happens, before any data has been seen, one decision has already been made that can decide whether the network ever learns anything at all: the scale of its initial random weights.

The mental model

A signal passed through many layers either shrinks toward zero or grows without bound, purely as a function of the variance of the weights it started with — and this has nothing to do with the optimizer. Choose the initial variance so that variance stays roughly constant from layer to layer, and the failure disappears before training even begins.

A failure that predates learning

It is tempting to think of a badly-trained network as a story about gradient descent — the wrong learning rate, too few steps, a bad optimizer. But some of the worst failures happen before the optimizer takes a single step. If the initial weight variance is too small, activations shrink layer over layer, and so do the gradients flowing back through them, until both are effectively zero before learning starts. If the variance is too large, activations blow up instead. Neither failure is about the training algorithm; both are entirely about the starting point.

THE SAME FIVE-LAYER NETWORK, TWO STARTING SCALES too small too large layer 1 layer 5
Figure 10a The same five-layer signal path under two starting weight scales. Too small, and the amplitude collapses toward zero by the final layer. Too large, and it grows without bound. Neither trajectory has been touched by an optimizer yet.

Xavier: matching variance across a layer

Glorot and Bengio's "Understanding the Difficulty of Training Deep Feedforward Neural Networks" (AISTATS 2010) states the goal precisely: choose the initialization variance so that the variance of activations in the forward direction, and the variance of gradients in the backward direction, stays roughly constant across layers. The derivation assumes linear or tanh-like activations, and it lands on a variance scaled as roughly 1/fan_in, or, in the form usually implemented, 2/(fan_in + fan_out) — a compromise that keeps both the forward and backward pass balanced at once.

Xavier / Glorot initialization Var(W) ≈ 2 / (fan_in + fan_out)

Why ReLU broke the derivation

Glorot's derivation assumes an activation that is, to first order, symmetric around zero — a reasonable approximation for tanh. The rectified linear unit is not that kind of function. ReLU zeros out roughly half of all activations — everything below zero — which halves the variance passed forward compared to a linear or tanh unit at the same input variance. A variance formula derived for a symmetric activation quietly starts underestimating the variance loss the moment the activation is ReLU.

INPUT TO THE UNIT OUTPUT AFTER RELU negative half positive half clipped to zero passes through
Figure 10b A ReLU unit's roughly symmetric input distribution, next to its output distribution: the entire negative half is clipped to zero, so only the positive half survives — exactly the factor-of-two variance loss He initialization corrects for.

He: correcting for the missing half

He, Zhang, Ren and Sun's "Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification" (arXiv:1502.01852, 2015 — the same paper that introduces PReLU) derives the correction directly from that observation. Since ReLU halves the variance passed forward relative to a linear or tanh unit, He initialization uses a variance of 2/fan_in specifically to compensate for that factor-of-two loss.

He initialization Var(W) = 2 / fan_in

The target is exactly the one Glorot set out: keep variance roughly constant across layers. What changes is the accounting — He initialization restores that same constant-variance property, but does so while correctly crediting ReLU's effect on the forward pass, rather than assuming the symmetric activation that Glorot's derivation was built around.

Plate 10.1 Figure 10a, but the two starting scales are yours to choose. Pick He with a ReLU stack and 20 layers — the final bar should sit close to 1x; check it. Drag the mis-scale multiplier to 3x and watch the same 20 layers blow up the way the lecture's "too large" sketch describes, or to 0.3x and watch it collapse the way "too small" does. No optimizer has touched this yet — it is the network's state before a single training step.

A one-time decision with a lasting effect

Initialization is unusual among the topics in this volume because it does nothing at all after the first forward and backward pass — every weight update from then on is the optimizer's doing. But a network that starts with vanishing or exploding signal may never recover, no matter how well-tuned the optimizer from Lecture 7 or the normalization from Lecture 8 is. Depth, in other words, does not just need an optimizer that copes with a bad loss surface and a normalization scheme that keeps activations well-behaved during training — it needs a starting point that does not already doom the signal before either gets a chance to help.

Where this sits relative to Lecture 8

Batch and layer normalization keep activations well-scaled throughout training, layer by layer, on every forward pass. Initialization only sets the scale once, at the very first pass, before any data has updated a single weight. The two are complementary, not competing: one fixes the starting point, the other keeps correcting the signal for every step afterward.

Two derivations, two activation assumptions
SchemeTarget activationVariance
Xavier / Glorot (2010)Linear / tanh-like≈ 2 / (fan_in + fan_out)
He (2015)ReLU family2 / fan_in

Read the primary source