Forward vs. backward: Glorot's compromise

One layer, h = Wx, drawn node by node. On the way forward, each output sums nin weighted inputs; on the way backward, each input's gradient sums nout weighted output gradients. So forward stability wants Var(W) = 1/nin and backward stability wants 1/nout. Unless the layer is square, no single variance gives both.

A fully connected layer with n_in input nodes on the left and n_out output nodes on the right; one output's incoming fan is highlighted in blue and one input's outgoing fan in orange.
forward: each output sums nin products
backward: each input's gradient sums nout products
the weight variance of the chosen scheme
nin 48 nout 192
For each of four initialization schemes, a bar for the forward factor n_in Var(W) and one for the backward factor n_out Var(W), on a log scale where 1 means perfectly preserved.
Bars: each scheme's forward factor nin·Var(W) (solid) and backward factor nout·Var(W) (faint), log scale; 1 (the dark line) means the variance passes through the layer unchanged. Click a scheme to show its numbers above. Standard (Var = 1/(3nin)) shrinks the forward signal to 1/3 at every layer. Forward Xavier fixes the forward factor at 1 but leaves the backward factor at nout/nin, and backward Xavier does the reverse. Glorot uses the harmonic mean of the two ideal variances, 2/(nin + nout), so the two factors always average to exactly 1: neither is ever more than 2× too large, and the other errs by (nin + nout)/(2nsmaller), always less than the nlarger/nsmaller that a one-sided Xavier suffers. For a layer that expands 4×, Glorot gives 0.4 and 1.6, where forward Xavier gives 1 and 4. The rules behind both formulas are on the variance page. Both factors assume the activation is roughly the identity near 0, as tanh is.