liveBook · Manning

Branin function

As explained in Ensemble Methods for Machine Learning

The Branin function is a two-variable mathematical test function with multiple local minima used to study optimization algorithms.

The Branin function is a two-variable test surface for optimization. Its four local minima make it useful for seeing why search direction and initialization matter. section 5.1.1

Its role becomes intuitive through visualization and descent:

  • A grid search can miss minima when coarse or become slow when excessively fine. section 5.1.1
  • Gradient descent follows the negative gradient, using line search and convergence checks to approach one local minimum. section 5.1.1

A concrete descent run

Implement the Branin function and its gradient, start at [-4, -5], and record the path. The trajectory converges to one minimum, zigzagging with smaller steps near the solution.

How Ensemble Methods for Machine Learning covers it

How deep it goes
Defines the function, visualizes its minima, and implements its gradient, stopping short of broader optimization theory.
Examples
Demonstrates surface and contour plots, a grid-search contrast, and a descent path from [-4, -5].
What it assumes
Assumes familiarity with first derivatives while defining the gradient as the surface’s local slope.
What you can do after
Builds a Branin objective and gradient, then applies gradient descent with line search and inspects the resulting path.
How it connects
Connects local minima, gradients, gradient descent, line search, initialization, and convergence.

This explainer was generated by Manning's knowledge graph from the text of Ensemble Methods for Machine Learning. The section links point to the parts of the book it draws on.