How Weight Initialization Works
Constant Initialization
Why zeros and ones both fail as starting weights
Weight
0.50
H1 Value
0.291
H2 Value
0.525
Unique Out
1
All weights identical → every neuron in a layer is a clone. Gradients are identical too — the network can never learn different features. Random values are needed to break this symmetry.
Step 1 of 5: Constant Initialization
Why zeros and ones both fail as starting weights
Weight
0.50
H1 Value
0.291
H2 Value
0.525
Unique Out
1
All weights identical → every neuron in a layer is a clone. Gradients are identical too — the network can never learn different features. Random values are needed to break this symmetry.
Step 2 of 5: Random Initialization
Random values beat constants, but the scale matters
Bound
0.50
H1 Std
0.385
H2 Std
0.238
Grad @ Input
0.322
Symmetry broken! Each neuron computes a different value (see the network above). The histograms show healthy spread across layers. But does this scale work for all layer widths? We need a principled rule.
Step 3 of 5: The 1/√n Rule
A simple recipe that adapts initialization to layer width
Shape
Uniform
Widths
32→32→32→32→32
Naive L5 Std
0.643
Recipe L5 Std
0.047
The recipe y = 1/√n scales initialization to the layer width. Uniform sampling keeps activations stable (L5 std = 0.047) while naive uniform drifts (L5 std = 0.643).
Step 4 of 5: Xavier, He & Activations
Named methods tuned for specific activation functions
Shape
Uniform
Widths
16→16→16→16→16
Xavier Last Std
0.329
He Last Std
0.576
Both Xavier and He are variations of the 1/√n rule. Each comes in two flavors: Normal (sample from a Gaussian) and Uniform (sample from a flat distribution with the same variance). Currently using Normal: Xavier ~ N(0, √(2/(n_in+n_out))), He ~ N(0, √(2/n_in)). Xavier (Glorot, 2010) averages fan-in and fan-out for symmetric activations (tanh, sigmoid). He (Kaiming, 2015) uses only fan-in with a ×2 factor for ReLU. With tanh: Xavier last std = 0.329, He last std = 0.576.
Step 5 of 5: Training Comparison
Watch how different initializations affect actual learning
Epoch
0
1/√n Loss
0.378
Best
Ones
Weight Std
0.191
1/√n recipe → fastest convergence (loss = 0.378). Weight distribution stays centered near zero with controlled spread. This is what the W&B article demonstrates: principled initialization beats everything.