Gradient descent is an optimization technique that repeatedly changes model weights to reduce a cost function. It uses the slope at the current point to choose a direction and step size: move opposite the gradient, with the learning rate controlling the step. section 9.8 section 9.26
A neural network training cycle uses gradient descent like this:
- Evaluate the network and calculate its error or cost. section 9.8
- Use backpropagation and the Chain Rule to calculate each weight’s gradient. section 9.26
- Update every weight in the direction that lowers cost, scaling the change by the learning rate. section 9.26
- Repeat the process across the training data, while watching for overfitting from training too long. section 9.8
Finding the valley
Imagine standing on a dark, hilly cost landscape. A positive slope means moving forward increases error, so move backward; a negative slope means moving forward decreases error, so move forward. A flat slope may indicate that the minimum is near. In a diffusion model, the same pattern updates weights so predicted noise becomes closer to actual noise over many training steps. section 9.8 section 12.23
Figure 9.25 Example of adjusting a weight by using gradient descent
Visualizes an individual weight adjustment using gradient descent. section 9.8
















