12. Coordinate Descent and Conjugate Gradient — Coordinates and Conjugate Directions
// CORE 6/7— coordinate descent, conjugate gradient, preconditioning
Not every algorithm uses the full gradient or Hessian at once. Coordinate descent moves one coordinate at a time, while conjugate gradient quickly solves linear systems along special directions.
Coordinate descent
Coordinate descent optimizes one coordinate or one coordinate block at a time:
It is highly efficient when each coordinate subproblem is cheap to solve. It is useful for Lasso, matrix factorization, and some large-scale ML problems.
Coordinate-selection methods
| Method | Description |
|---|---|
| Cyclic | Visit coordinates in a fixed order |
| Randomized | Select a random coordinate |
| Greedy | Choose the coordinate expected to reduce the objective most |
| Block | Update a group of coordinates together |
It is fast when the coordinate axes align well with the problem structure, but may be slow when variables are strongly coupled.
Conjugate gradient
Conjugate gradient is an iterative method for solving a symmetric positive-definite linear system:
It can simultaneously be viewed as minimizing the quadratic function
The gradient is , and it is zero at the solution.
Conjugate directions
CG does not simply follow the gradient. It constructs directions that are mutually -conjugate:
As a result, the next direction does not undo what was already optimized in a previous direction. In exact arithmetic, an -dimensional problem is solved within at most iterations. With actual floating-point arithmetic, errors make preconditioning important.
Preconditioning
Preconditioning transforms a difficult system into a better-conditioned system.
Original problem:
With a preconditioner , solve approximately the following form:
The goal is to reduce the condition number of . A good preconditioner satisfies two conditions:
- It approximates well.
- Solving is cheap.
When to use each method
| Method | Good fit |
|---|---|
| Coordinate descent | Coordinatewise optimization is cheap and the structure separates |
| Conjugate gradient | Large SPD linear system; Hessian-vector products are available |
| Preconditioned CG | A large condition number makes CG slow |
Newton-CG reduces cost on large-scale problems by approximating the Newton step with CG instead of solving it exactly.
Next: Expensive Optimization