A hidden layer with nin=256 independent inputs (each of mean 0 and variance 1) computes z=w⊤x with zero bias, which gives Var⁡(z)=nin σW2 when weights are drawn independently with mean 0 and variance σW2. What is the standard deviation of z under N(0,1) (σW2=1) versus Xavier-style normal N(0,1/nin) (σW2=1/256), and why does N(0,1) stall training under a tanh⁡ activation?

Deep learning, Weight initialisation
Level L2 Elementary. Length Short. Nature Mat Mathematical.

What's being asked

Whether you can compute pre-activation spread from a given variance formula and link wide pre-activations to saturating gradients.

Key idea

Because Var⁡(z)=ninσW2=256 σW2, drawing weights from N(0,1) gives σz=256=16, pushing tanh⁡(z) deep into its flat saturated tails where gradients vanish; Xavier-style normal sets σW2=1/256 (σW=1/16) so σz=1.

Steps

  1. Apply the given variance rule Var⁡(z)=ninσW2=256 σW2, and recall that the standard deviation is σz=Var⁡(z).
  2. Under N(0,1) (σW2=1): Var⁡(z)=256, so the standard deviation of z is σz=256=16.
  3. Under Xavier-style normal (σW2=1/256, σW=1/16=0.0625): Var⁡(z)=256 (1/256)=1, so the standard deviation of z is σz=1.
  4. Why N(0,1) stalls tanh⁡: typical pre-activations reach around ±16, where tanh⁡(z) flattens near ±1 and its slope tanh⁡′(z)=1−tanh⁡2(z) drops close to zero (about 5×10−14), killing gradients; at σz=1, values stay in the active central region where tanh⁡′(1)≈0.42.

Common mistakes

How long your answer should be

4–5 lines with both standard deviations and why large ∣z∣ saturates tanh⁡.

Read this

Previous in Deep learning: In a small computation graph, input x=2 feeds two branches that share the same weight w=3: a=wx and b=(w−1)2, and the loss is L=12(ab−20)2. How do you compute ∂L∂w by backpropagation, and what happens if an implementation overwrites instead of accumulating branch gradients?
Next in Deep learning: Why are bias vectors and normalisation scale/shift parameters (γ,β) usually excluded from L2 weight decay in deep neural networks?