Skip to main content
Luxara Academy

Archive — one question answered

Learning rate: 0.001 or 0.1?

A learning rate that is too large turns loss into NaN — how do you pick η?

Learning rate η\eta sets the step size each update. Too small — e.g. η=10−6\eta = 10^{-6} for 20 steps — loss might only move from 0.690.69 to 0.680.68, training crawls. Too large — η=1.0\eta = 1.0 with gradients around 1010 — one jump sends weights into saturated sigmoid, gradients vanish or loss goes NaN.

On the course spam toy net, η=0.1\eta = 0.1 often works for one NumPy neuron; η=0.01\eta = 0.01 is safer before input scaling. Practice: try 0.10.1, 0.010.01, 0.0010.001 with the same seed, print loss every 5 steps.

η\etaLoss after 20 steps (example)
0.10.42 — healthy drop
1.0NaN

There is no magic number for every net; there is a ritual of watching curves. The Deep Learning track shows both extremes before the learning-rate widget compares loss paths. When you move to larger nets later, schedulers and warmup help, but the same question remains: did the first 20 steps improve loss or blow up?