A gradient collects the first derivatives of a function with respect to its variables. Intuitively, it measures the local slope of a surface and points toward steepest ascent. To minimize a function, move in the opposite direction. section 5.1.1
This turns optimization into a guided search. Rather than evaluating every point on a potentially expensive grid, use derivative information to choose a promising direction, then decide how far to move. For a loss function, descending the gradient seeks a model with lower error. section 5.1 section 5.1.1
A gradient-descent iteration proceeds as follows:
- Compute the negative gradient at the current position. section 5.1.1
Following the Branin surface
The two-variable Branin function provides a visual example. Starting at [-4, -5], gradient descent follows a descending path toward one of several local minima. Near the solution, steps become smaller and the path may zigzag; different starting points can reach different minima. section 5.1.1
Figure 5.2 The surface plot (left) and contour plot (right) of the Branin function. We can visually verify that this function has four minima, which are the centers of the elliptical regions in the contour plot.
Use the surface and contour plots to relate gradient direction to the geometry of local minima. section 5.1.1



















