↗Prince Jewu.

A small model.
A visible learning step.

Fit a line to three invented training points. Take a gradient-descent step and watch the prediction line and training loss change.

ŷ = wx + b θ ← θ − η∇L

A maths demonstration, not a benchmark. Lower loss on these three points says nothing about performance on unseen data.

LINEAR REGRESSION / TOY DATASTEP 0
A linear model learning from three pointsTraining examples are (1,2), (2,4), and (3,6). The prediction line changes after each update. Current values are listed below the chart.02460123xy
● Training examples― Model prediction
WEIGHT w0.400
BIAS b0.200
TRAINING LOSS5.35333

Loading the learning lab…

See the maths +

For n = 3 examples, L = (1 / 2n) Σ(ŷ − y)². The gradients are ∂L/∂w = mean[(ŷ − y)x] and ∂L/∂b = mean[ŷ − y]. Each update uses both gradients from the same starting parameters.

Data: (1, 2), (2, 4), (3, 6). Start: w = 0.4, b = 0.2. The known zero-loss line for these toy examples is y = 2x.