Optimization basics

Processing Prerequisites

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 Ax=bAx = b is hatx=(ATA)−1ATb\\hat x = (A^{T}A)^{-1}A^{T}b. 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 f(x)f(x) measures how bad a proposed solution xx is. The optimizer’s job is to find the xx that makes f(x)f(x) as small as possible. For seismic:

  • Least-squares inversion: f(x)=∣Ax−b∣_22f(x) = \\|Ax - b\\|\_2^2. Convex, so every local minimum is global; the minimum is unique when AA has full column rank. Closed-form solution available.
  • FWI: f(m)=tfrac12∣,mathcalF(m)−d,∣2f(m) = \\tfrac{1}{2}\\|\\,\\mathcal{F}(m) - d\\,\\|^{2}, where mm is the velocity model and mathcalF(m)\\mathcal{F}(m) is a wave-equation forward model. It is not convex in general and has many local minima.
  • Regularized inversion: f(x)=∣Ax−b∣_22+epsilon,∣Dx∣_22f(x) = \\|Ax - b\\|\_2^2 + \\epsilon\\,\\|Dx\\|\_2^2, where DD is a roughness operator. With D=ID = I it shrinks the solution norm; with DD a derivative it smooths the solution.

2. Gradient descent

xk+1=xk−α ∇f(xk)x_{k+1} = x_{k} - \alpha\,\nabla f(x_k)

Take a step in the direction opposite the gradient. The step size alpha\\alpha (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, m_1m\_1 and m_2m\_2: (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 f=m_12+5m_22f = m\_1^2 + 5m\_2^2 with alpha=0.19\\alpha = 0.19.

Gradient descent on a cost surfaceminimumEach step descends the gradient of the misfit functional

At that opening step every iteration overshoots the steep m_2m\_2 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 alpha\\alpha to the best fixed step, alphaast=1/6\\alpha^{\\ast} = 1/6, which is 0.166 on the slider, and it converges in 25. Then try:

  • Round bowl, f=m_12+m_22f = m\_1^2 + m\_2^2, curvature 2 in every direction. At alpha=0.15\\alpha = 0.15 the path slides smoothly to the origin. At alpha=0.5\\alpha = 0.5 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, kappa=5\\kappa = 5 and 25: the level sets are long ellipses. Any step with alphalambda_max>1\\alpha\\lambda\_{\\max} > 1 (on the valley, alpha>0.1\\alpha > 0.1) 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, beta=0.45\\beta = 0.45 with alpha=0.0556\\alpha = 0.0556, brings that down to 36.
  • Two basins: at alpha=0.15\\alpha = 0.15, 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 alpha\\alpha, or use accelerated methods (momentum, conjugate gradients).
  • Zigzag and divergence. A step too large for the steepest direction (alphalambda_max>1\\alpha\\lambda\_{\\max} > 1 zigzags, alphalambda_max>2\\alpha\\lambda\_{\\max} > 2 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 f(x)=tfrac12xTAxf(x) = \\tfrac{1}{2}x^{T}Ax the Hessian is AA, and along its eigenvector with eigenvalue lambda_i\\lambda\_i each step multiplies the error by 1−alphalambda_i1 - \\alpha\\lambda\_i. Descent therefore diverges once alpha>2/lambda_max\\alpha > 2/\\lambda\_{\\max}, the optimal fixed step is alphaast=2/(lambda_max+lambda_min)\\alpha^{\\ast} = 2/(\\lambda\_{\\max} + \\lambda\_{\\min}), and the convergence rate depends on the condition number

kappa=lambda_max/lambda_min\\kappa = \\lambda\_{\\max}/\\lambda\_{\\min}

If kappa=1\\kappa = 1 and alpha=1/lambda\\alpha = 1/\\lambda, gradient descent converges in one step. At the optimal step the error shrinks by a factor (kappa−1)/(kappa+1)(\\kappa - 1)/(\\kappa + 1) per iteration, so kappa=100\\kappa = 100 needs about 50 iterations for each factor of ee. The valley in Figure 0.9 is f=m_12+5m_22f = m\_1^2 + 5m\_2^2, with Hessian eigenvalues 2 and 10, so kappa=5\\kappa = 5 and the best factor is 2/32/3. Plate (c) draws both multipliers, ∣1−alphalambda_min∣|1 - \\alpha\\lambda\_{\\min}| and ∣1−alphalambda_max∣|1 - \\alpha\\lambda\_{\\max}|, against alpha\\alpha 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 (kappa−1)/(kappa+1)(\\kappa - 1)/(\\kappa + 1) to about (sqrtkappa−1)/(sqrtkappa+1)(\\sqrt{\\kappa} - 1)/(\\sqrt{\\kappa} + 1).

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): +epsilon∣x∣_22+\\epsilon\\|x\\|\_2^{2} shrinks the norm toward zero. It adds epsilonI\\epsilon I to ATAA^{T}A, which bounds the smallest eigenvalue away from zero and stabilizes the inversion: every eigenvalue rises by epsilon\\epsilon, so kappa\\kappa falls to (lambda_max+epsilon)/(lambda_min+epsilon)(\\lambda\_{\\max} + \\epsilon)/(\\lambda\_{\\min} + \\epsilon).
  • Smoothing: +epsilon∣Dx∣_22+\\epsilon\\|Dx\\|\_2^{2}, where DD is a discrete derivative. Prefers smooth solutions. Tomographic velocity inversion uses this heavily.
  • Sparsity (L1): +epsilon∣x∣_1+\\epsilon\\|x\\|\_{1} 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:

  1. Run a wave-equation simulator forward to get predicted data.
  2. Subtract from observed data to get the data residual.
  3. Back-project the residual via the adjoint-state method to get a gradient in model space.
  4. Take a gradient step: m_k+1=m_k−alpha,g_km\_{k+1} = m\_k - \\alpha\\, g\_k.
  5. 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.

The one sentence to remember

Pick a cost function, compute its gradient, step downhill, repeat, with a step below 2/λmax⁡2/\lambda_{\max} 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.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.