Northeastern University · CS 7150 · Fall 2026

Initialization, explained

Nine interactive pieces on Glorot & Bengio 2010: first, what saturation is on a single tanh; then what the failure looks like while a real network trains, and the chain rule behind it, one neuron per layer, and how the choice of activation changes it; then what variance is, where the n in n·Var(W) comes from (forward and backward), where the 1/3 comes from, the two uniform initializations the paper compares, and why forward and backward stability pull the variance in different directions when a layer isn't square. (Their remark on why cross-entropy beats squared error at the output is now in losses and regularization.)

  1. Saturation

    Saturation on one tanh

    Twenty units on a single tanh curve, each drawn with its tangent line. Scale their inputs up and the tangents lie flat, so almost no gradient gets back; scale them down and every slope is 1, but the outputs huddle at 0.

    Open the explainer →
  2. The failure, in practice

    Bad init, watched training

    Not just the theory — a real 6-layer tanh network training live on two moons with plain gradient descent. Too-small init and the loss barely moves; too-big init and units saturate immediately and the boundary stays near its random start; Xavier trains cleanly. Decision boundary, loss curve, and per-layer activation histograms (or the whole network drawn neuron by neuron, weight by weight), all updating together.

    Open the explainer →
  3. Why gradients vanish

    Chain rule, one neuron deep

    Five tanh layers with one neuron each, drawn as a forward/backward computation graph. The gradient that reaches each weight is a product you can read off the graph, and it collapses for one of two reasons: a flat slope where a unit is saturated, or a near-zero input at a × node. Turn the weights up or down and watch which one bites.

    Open the explainer →
  4. tanh, sigmoid, relu

    Activations, watched training

    The live training demo with a switch between tanh, sigmoid and relu, and a He init button. Sigmoid stalls at Xavier because its slope is at most 1/4 and only trains with several times larger weights; relu is linear or off, loses half its variance per layer under Xavier, and holds steady under He.

    Open the explainer →
  5. What variance is

    Variance: an average square, and four rules

    Variance drawn as the average of squares hung on the samples, and the four rules that make it easy to push through a layer: scaling, sums, products, and their consequence Var(h) = n·Var(W)·Var(x).

    Open the explainer →
  6. Where the n comes from

    A matrix product of random numbers

    A matrix-vector product animated with every entry drawn as its probability density. Forward, each output adds up n products, so its variance is n·σw²; backward, the gradient goes through WT and each input's gradient adds up m. Glorot's dilemma, then several layers stacked.

    Open the explainer →
  7. Where the 1/3 comes from

    Why a uniform has variance a²/3

    Variance is an average square. Stack a uniform's squares and they form a pyramid in an a×a×a box; three such pyramids fill the box, so the average square is a third of the biggest.

    Open the explainer →
  8. Standard vs. normalized

    Standard vs. normalized init

    The paper's two uniform initializations side by side, as histograms and scatterplots, with the variance of a uniform on [−a, a] derived two ways: as an integral, and as the mean height of a parabola, which fills 1/3 of its bounding box.

    Open the explainer →
  9. Where 2/(n_in+n_out) comes from

    Forward vs. backward: Glorot's compromise

    Forward stability wants Var(W)=1/n_in; backward stability wants Var(W)=1/n_out. Set an asymmetric layer and watch neither forward-only nor backward-only Xavier satisfy both — and see why Glorot's averaged formula is the compromise that bounds the damage either way.

    Open the explainer →