Optimization basics
Learning objectives
- Write down a cost function and find its minimum by gradient descent
- Pick a step size that converges; recognize zigzag, slow, and divergent failures
- Explain why ill-conditioning (elongated level sets) slows gradient descent
- Connect cost, gradient, and regularization to FWI, tomography, and least-squares inversion
Section 0.7 handed us the normal equations: the best least-squares solution to is . That is a closed-form answer to a linear problem. FWI and modern seismic inversion are non-linear: the forward operator is a wave-equation simulator, not a matrix, and there is no closed-form solution. What replaces the matrix inverse is iterative optimization.
1. The cost function
A cost function measures how bad a proposed solution is. The optimizer’s job is to find the that makes as small as possible. For seismic:
- Least-squares inversion: . Convex, so every local minimum is global; the minimum is unique when has full column rank. Closed-form solution available.
- FWI: , where is the velocity model and is a wave-equation forward model. It is not convex in general and has many local minima.
- Regularized inversion: , where is a roughness operator. With it shrinks the solution norm; with a derivative it smooths the solution.
2. Gradient descent
Take a step in the direction opposite the gradient. The step size (also called the learning rate) controls how far. Too small and you crawl; too large and you overshoot or even diverge. Figure 0.9 runs this update on four costs over two model parameters, and : (a) draws the path on the cost surface, (b) the cost above the minimum at every iteration, and (c) how much one step multiplies the error along each direction of the surface. Drag the start point anywhere in (a), or set it with the sliders, and change the step. The figure opens on the valley with .
At that opening step every iteration overshoots the steep direction, so the path zigzags across the valley, yet the error still shrinks by a factor of 0.90 per step and descent converges in 96 iterations. Lower to the best fixed step, , which is 0.166 on the slider, and it converges in 25. Then try:
- Round bowl, , curvature 2 in every direction. At the path slides smoothly to the origin. At descent lands on the minimum in one step. Past 0.5 each step overshoots the minimum and the path zigzags across it (at 0.8 it still converges, in 18 iterations); at exactly 1 it bounces between two mirror points forever; beyond 1 every step overshoots by more than it corrects and the iterates diverge.
- Valley and narrow valley, and 25: the level sets are long ellipses. Any step with (on the valley, ) overshoots across the narrow direction, and any step small enough to avoid that crawls along the long one. On the narrow valley even the best fixed step on the slider, 0.0384, needs 141 iterations; momentum, with , brings that down to 36.
- Two basins: at , from the start (2.20, 2.40) descent reaches the global minimum at (1.27, 0.45) in 18 iterations; from (−1.80, 1.60), on the other side of the dashed ridge through the saddle, it stops in the local minimum at (−1.24, −0.53), 0.41 higher. Gradient descent falls into whichever minimum is downhill from its starting point; it has no way to see the other one. Finding the global minimum of a non-convex function has no efficient general guarantee, and for FWI’s millions of parameters exhaustive search is unaffordable; FWI uses frequency continuation and careful initialization instead.
3. Three pathologies the figure exposes
- Slow convergence. A step too small for the flat direction: a slow, monotone approach. Fix: increase , or use accelerated methods (momentum, conjugate gradients).
- Zigzag and divergence. A step too large for the steepest direction ( zigzags, diverges), which on an ill-conditioned surface is the only way to make progress along the flat direction. Fix: preconditioning, or quasi-Newton methods that use curvature information, so that one step suits every direction.
- Local minimum. A non-convex surface. Fix: multi-start, annealing, frequency continuation in FWI, or convex relaxations.
4. The Lipschitz / condition-number connection
For a quadratic the Hessian is , and along its eigenvector with eigenvalue each step multiplies the error by . Descent therefore diverges once , the optimal fixed step is , and the convergence rate depends on the condition number
If and , gradient descent converges in one step. At the optimal step the error shrinks by a factor per iteration, so needs about 50 iterations for each factor of . The valley in Figure 0.9 is , with Hessian eigenvalues 2 and 10, so and the best factor is . Plate (c) draws both multipliers, and , against and shades the larger of the two, the one that sets the pace: the best step sits at the lowest point of that shaded V, where the two curves cross, and the steps that diverge are hatched.
Every practical inversion is ill-conditioned: the Jacobian’s singular values span many orders of magnitude. The solutions people actually use are conjugate gradients, preconditioning, and quasi-Newton updates like L-BFGS. These are all in the same family as gradient descent; they spend more memory or compute per step to bend the trajectory toward the minimum. Momentum in Figure 0.9 is the smallest example: it cuts the multiplier at the best step from to about .
5. Regularization: adding a penalty
If the cost has many equally good solutions, or the gradient is unstable near the optimum, add a penalty that breaks ties toward desirable solutions:
- Tikhonov (L2): shrinks the norm toward zero. It adds to , which bounds the smallest eigenvalue away from zero and stabilizes the inversion: every eigenvalue rises by , so falls to .
- Smoothing: , where is a discrete derivative. Prefers smooth solutions. Tomographic velocity inversion uses this heavily.
- Sparsity (L1): prefers sparse solutions with few non-zero entries. Compressed-sensing reconstruction lives here.
6. From one iteration to FWI
FWI is the outer loop above the figure. Every FWI iteration:
- Run a wave-equation simulator forward to get predicted data.
- Subtract from observed data to get the data residual.
- Back-project the residual via the adjoint-state method to get a gradient in model space.
- Take a gradient step: .
- Check the stopping criterion; loop.
One FWI iteration on a modern 3D dataset can take thousands of CPU hours. The efficiency of the outer optimizer (gradient vs. L-BFGS vs. truncated-Newton) directly determines how many iterations you can afford. The basins of FWI’s misfit are cycle skips: a starting model whose traveltimes are off by more than half a period descends to the wrong wiggle, exactly as a start on the wrong side of the ridge does in Figure 0.9.
Pick a cost function, compute its gradient, step downhill, repeat, with a step below so the iterates cannot diverge, a method that copes with ill-conditioning, a starting point in the right basin, and a regularizer strong enough to stabilize. That recipe underlies FWI, tomography, least-squares migration, and every modern seismic inversion.
Where this goes next
Part 0 closes with Section 0.10: the wave equation. The physics behind the simulator inside FWI, the propagation model that migration inverts, and the starting point for modern imaging. Thirty minutes of PDEs, then we are out of prerequisites and into processing proper.
References
- Strang, G. (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge.
- Tarantola, A. (1984). Inversion of seismic reflection data in the acoustic approximation. Geophysics, 49, 1259.
- Virieux, J., Operto, S. (2009). An overview of full-waveform inversion in exploration geophysics. Geophysics, 74, WCC1.
- Pratt, R. G. (1999). Seismic waveform inversion in the frequency domain, Part 1. Geophysics, 64, 888.