liveBook · Manning

Learning rate

As explained in Math and Architectures of Deep Learning

The step-size setting that controls how far model parameters move on each optimization update, possibly chosen separately for each parameter dimension.

A learning rate is the step-size setting used when optimization moves neural-network parameters such as weights and biases. Training repeatedly adjusts these parameters to reduce a loss and bring predictions closer to known targets. In gradient descent, the update moves opposite the gradient; the learning rate controls how far that move goes. section 8.4 section 8.4.3

The gradient supplies the direction of steepest local decrease, while the learning rate supplies the scale. A larger value can make optimization progress faster, but it can also overshoot the minimum. The rate is therefore a tunable hyperparameter rather than a learned model parameter. section 8.4.3

A typical PyTorch training step applies the learning rate through the optimizer:

  • Create a loss function and an SGD optimizer, setting the rate with `optim.SGD(model.parameters(), lr=0.02)`. section 9.2.3
  • For each minibatch, compute model scores and loss, clear old gradients, backpropagate with `loss.backward()`, and update parameters with `optimizer.step()`. section 9.2.3
  • Repeat the loop across epochs while monitoring whether the loss decreases and predictions improve. section 9.2.3

Classifying Statsville residents

A neural network receives height and weight and predicts whether each resident is a man, woman, or child. Its SGD optimizer uses a learning rate of 0.02; successive epochs reduce the loss, with most training examples classified correctly after the first epoch. section 9.2.3

Equation 8.15

Equation 8.15 connects the learning rate to the local gradient-descent step and the direction producing the largest decrease. section 8.4.3

How Math and Architectures of Deep Learning covers it

How deep it goes
Explains gradient direction, Taylor approximation, Hessian context, and PyTorch configuration, while deferring fuller optimization details.
Examples
Uses a Statsville height-and-weight classifier, an SGD setting of 0.02, and epoch-by-epoch loss reduction.
What you can do after
Apply it via PyTorch by configuring SGD and interpreting its effect on training progress and overshooting risk.
How it connects
Connects gradient descent, loss functions, backpropagation, stochastic gradient descent, and Hessian matrices.

Also explained in

Compare how 16 books explain learning rate →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.