Log inStart free
LESSON 5.C3 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

One training step end to end

Follow one batch through forward pass, loss, backpropagation and an Adam update.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 5.C3 · TRAINING BAYSTEP 1 · 4 POINTS FORWARD
01
Stage 1 of 6 · Forward pass
Step 1: the 4 XOR points run forward through the starting weights. Each point gets a prediction ŷ.
Explain it simply

A training step starts with a forward pass. All four XOR points go through the network at once, as one batch. Each hidden neuron adds up its weighted inputs and keeps only the positive part. The output squeezes its sum into a number between 0 and 1, the prediction.

Step 1. Four inputs, four hidden rows and four predictions: 0.50, 0.33, 0.51, 0.39.

inputs, hidden values, targetsweights and biasesprediction ŷ and step Δwlosses and gradientsa 0 from ReLU, or a negative weight
0000000.50010.930.9500.400.33100000.760.51110.650.7401.160.39w11−0.2800w120.9300w21−0.2100w220.9500w31−0.1400w32−0.8700w410.7600w420.4000b10.0000b20.0000b30.0000b40.0000wout,1−0.8700wout,20.1100wout,30.0700wout,40.0300bout0.0000step 1 · Adam, η 0.05x₁x₂h₁h₂h₃ (off for all 4)h₄ŷw5.02 forward pass5.09 loss5.03 backprop2.29 Adamŷ = 0.500, 0.333, 0.506, 0.3900000000.50010.930.9500.400.33100000.760.51110.650.7401.160.39w11−0.2800w120.9300w21−0.2100w220.9500w31−0.1400w32−0.8700w410.7600w420.4000b10.0000b20.0000b30.0000b40.0000wout,1−0.8700wout,20.1100wout,30.0700wout,40.0300bout0.0000step 1 · Adam, η 0.05x₁x₂h₁h₂h₃ (off for all 4)h₄ŷw5.02 forward pass5.09 loss5.03 backprop2.29 Adamŷ = 0.500, 0.333, 0.506, 0.390
Toy: a 2-4-1 MLP · the 4 XOR points as one batch · 5.02's seeded start
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
hj=ReLU⁡(wj1 x1+wj2 x2+bj)y^=σ(wout⋅h+bout)\begin{gathered} \sy{h}{data}{h_j} = \operatorname{ReLU}(\sy{w}{param}{w_{j1}}\,\sy{x}{data}{x_1} + \sy{w}{param}{w_{j2}}\,\sy{x}{data}{x_2} + \sy{w}{param}{b_j}) \\ \sy{yhat}{out}{\hat y} = \sigma(\sy{w}{param}{\mathbf w_{\text{out}}} \cdot \sy{h}{data}{\mathbf h} + \sy{w}{param}{b_{\text{out}}}) \end{gathered}
y^=(0.500, 0.333, 0.506, 0.390)\hat{\mathbf y} = (0.500,\ 0.333,\ 0.506,\ 0.390)

Each neuron sums its weighted inputs and keeps the positive part.

Common mix-ups

MYTHBackpropagation changes the weights.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01Switch to SGD. Does every weight with a gradient still move by the same amount?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 2 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.