When the gradient need not vanish
The topic Unconstrained optimization gave us a test for a minimum, , and gradient descent to find one. Many ML problems, however, restrict where may go. At a restricted minimum the gradient is usually not zero, so we need a new test.
Constraints are everywhere in ML:
- class probabilities lie on the simplex: and ;
- the first principal component is a unit vector: ;
- a max-norm weight constraint or gradient clipping keeps a vector in a ball: .
The general problem has inequality constraints and equality constraints :
A point that satisfies all constraints is called feasible.
The running example of this topic is
Here the constraint can simply be eliminated. Substitute : the function is minimal at . So and . Note that : the unconstrained test fails at a perfectly good minimum.
Elimination does not scale. A circle gives : two branches and a square root. With constraints , each one may hold with equality or not, which makes cases. We need a rule that works with the constraints as given.