This Optimization concept is the current object: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.
Optimization
Weight Initialization: Xavier, He & muP
How to pick weight scales so activations/gradients stay stable: Xavier/Glorot, He/Kaiming, and width-scaling ideas like muP.
Concept Structure
Weight Initialization: Xavier, He & muP
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Commit a prediction against the code witness.
Learner Contract
What this page should let you do.
2 prerequisites listed; refresh them before leaning on the math or code.
Explain the mechanism, trace the main notation, and answer the prediction probe against the code witness.
Read the intuition before the notation; the math should name a mechanism you already felt.
Follow this edge after making one prediction here; the next page should reuse the result, not restart the route.
Claim/source review status
Claim review not recorded
No structured claim checks yet; source metadata is not enough to establish support.Metadata-derived; review may be AI-assisted. Not a human certification.01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
Initialization is the starting geometry of learning.
If weights are too small, signals shrink as they pass through layers and gradients vanish. If weights are too large, activations and gradients explode and training becomes unstable.
Good initializations aim to keep the "scale" of information roughly constant as it flows forward (activations) and backward (gradients).
Two classics:
- Xavier/Glorot: good for tanh/sigmoid-like activations.
- He/Kaiming: good for ReLU-like activations (because ReLU zeros out about half of inputs).
Modern scaling work adds another layer: you want hyperparameters to transfer as width changes. muP is one way to parameterize networks so you can tune on a small model and scale up with fewer surprises.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Consider a linear layer where has i.i.d. components with . Assume are i.i.d. with mean 0 and variance .
Then each output coordinate is a sum of terms, so:
To keep variance stable across layers (), set:
This motivates Xavier-like scaling. For ReLU, roughly half the mass is zeroed, so to keep variance stable you use about twice the variance:
muP (Maximal Update Parameterization) extends this idea to updates: scale parameters and learning rates with width so that update magnitudes stay comparable across model sizes.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import numpy as np
rs = np.random.RandomState(0)
def run(depth=20, width=512, scale=1.0, relu=True):
x = rs.randn(width)
vars = []
for _ in range(depth):
W = rs.randn(width, width) * (scale / np.sqrt(width))
x = W @ x
if relu: x = np.maximum(x, 0)
vars.append(float(x.var()))
return vars
for name, scale in [("too small", 0.3), ("xavier-ish", 1.0), ("too large", 3.0)]:
v = run(scale=scale)
print(name, "var@layer1", round(v[0], 3), "var@layer20", round(v[-1], 3))
04
Interactive Demo
Use the authored prediction probe to test the mechanism without a live widget.
Prediction check: before running the witness, rank too small, xavier-ish, and too large by their expected layer-20 variance. Then change relu=False and see how the activation choice changes the initialization scale that feels stable.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
How to pick weight scales so activations/gradients stay stable: Xavier/Glorot, He/Kaiming, and width-scaling ideas like muP.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Weight Initialization: Xavier, He & muP should make visible.
Visual Inquiry
Make the image answer a mathematical question
How to pick weight scales so activations/gradients stay stable: Xavier/Glorot, He/Kaiming, and width-scaling ideas like muP.
Which visible object should carry the first intuition?
Pick the cue that should make Weight Initialization: Xavier, He & muP easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Add source metadata before treating this page as source-grounded.
Claim Review
How to pick weight scales so activations/gradients stay stable: Xavier/Glorot, He/Kaiming, and width-scaling ideas like muP.
Source IDs and witness objects are attached for review; they are not proof by themselves.
Add source metadata before claiming support.
Use equation, code, and demo objects to check whether the source support is operational.
Source support candidates
No structured source note is attached yet.
Practice Loop
Try the idea before it explains itself
How to pick weight scales so activations/gradients stay stable: Xavier/Glorot, He/Kaiming, and width-scaling ideas like muP.
Before touching the demo, predict one visible change that should happen in Weight Initialization: Xavier, He & muP.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to an exact object
Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.Open the draft below to save one note and next action in this browser.
Weight Initialization: Xavier, He & muP
What is the smallest example that makes Weight Initialization: Xavier, He & muP click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays locally in this browser for concept:optimization/weight-initialization.
- Definition, prerequisite, and contrast concept links
- The equation or code witness that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Weight Initialization: Xavier, He & muP Object key: concept:optimization/weight-initialization Context: Optimization Anchor id: concept/concept-notebook/optimization/weight-initialization Open question: What is the smallest example that makes Weight Initialization: Xavier, He & muP click without losing the math? Evidence to inspect: - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.
concept/concept-notebook/optimization/weight-initialization
concept:optimization/weight-initialization