liveBook · Manning

Locally optimal solution

As explained in Natural Language Processing in Action, Second Edition

A local minimum is a point where an objective function has a value no greater than that of nearby points, without necessarily being the global minimum.

A locally optimal solution is a point where the objective cannot improve by moving to a nearby point. It may still be worse than the global minimum elsewhere. In neural-network training, a nonconvex error surface can leave randomly initialized weights in a local minimum, where no downhill path is immediately available. section 5.3.1 section 5.3.2

Training practices address local minima indirectly:

  • Monitor error or a related metric over training time; continued reduction indicates that optimization is still moving in a useful direction. section 5.3.1
  • Shuffle training examples between passes so the optimizer follows a changing path rather than repeatedly descending the same static error surface. section 5.3.2
  • Avoid overly ordered sampling in recurrent-network training; consistent alphabetic ordering can specialize predictions and trap optimization in local minima. section 8.3.1

Skiing into a divot

Imagine skiing downhill on a landscape of divots and pits. Starting from different random positions can lead to different stopping points. Reaching the bottom of one nearby pit does not prove that the lowest point on the whole landscape has been found. section 5.3.1 section 5.3.2

Figure 5.7 Nonconvex error curve
figure

Inspect the nonconvex error curve to visualize how optimization can descend into a local minimum instead of reaching the global minimum. section 5.3.1

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains nonconvex error surfaces, random starts, and practical monitoring, but does not derive optimization mathematics.
Examples
Uses ski slopes, nonconvex error curves, random weight initialization, shuffled samples, and ordered RNN training data.
What it assumes
Assumes familiarity with model weights, error, gradient descent, and neural-network training.
What you can do after
Diagnose training stagnation by monitoring error and apply stochastic shuffling to vary the optimization path.
How it connects
Connects local minima with gradient descent, stochastic gradient descent, global minima, error surfaces, and neural-network training.

Also explained in

Compare how 9 books explain locally optimal solution →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.