Gradient descent steps
One gradient descent update subtracts the learning rate times the current gradient.
On this page 8 sections
01Gradient descent updates parameters by moving against the loss’s local sensitivity#
Gradient descent updates parameters by moving against the loss’s local sensitivity. A positive derivative means increasing that parameter raises the loss locally, so the update subtracts it. The learning rate controls how much of this direction to take.
Gradient descent moves opposite the current gradient when minimizing an objective. Scale the gradient by a positive learning rate, then subtract:
At θ=(4,−1), gradient (2,−4) and rate 0.5 give a scaled gradient (1,−2). Subtract it to get (3,1).
With parameter , gradient , and learning rate 0.1, first scale the gradient to . Then subtract coordinatewise: . Subtracting a negative gradient increases that parameter. The gradient itself is not the new parameter.
Current , gradient , . Find the descent update.
Show answer and explanation
Subtract coordinatewise: .
02A closer look#
If the gradient is not supplied, differentiate the stated objective and evaluate it at the current parameter.
Use that current gradient in the update. Do not substitute the objective value in place of its derivative.
. Start , rate . Find the next x.
Show answer and explanation
Derivative 4(x−3) gives 8; new x is 5−0.25(8)=3.
03Adding a nonzero gradient gives an ascent direction#
Adding a nonzero gradient gives an ascent direction. Subtracting an unscaled gradient silently uses a learning rate of 1.
A correctly computed update is one step. Its effect on loss still depends on the step size and objective.
Current , , . Draft update: . Repair it.
Show answer and explanation
Subtract coordinatewise: .
04Training repeats this operation using a gradient evaluated at the current parameter#
Training repeats this operation using a gradient evaluated at the current parameter. After moving, the old gradient is generally no longer the current one. The method needs a sensible step size; the minus sign alone does not guarantee the next loss is smaller.
Evaluate the current gradient, scale every coordinate by the rate and subtract from the current parameter.
- Compute one gradient descent update.
Sources & further reading
- [1]Dive into Deep Learning §12.3.1–12.3.2 ↗Dive into Deep Learning §12.3.1–12.3.2 · Article