Techniqueadvanced
Adjoint-state method
Also called adjoint-state gradient, adjoint method.
Compute the gradient of a misfit with respect to all model parameters at the cost of two wave simulations, one forward and one adjoint.
The adjoint-state method computes the gradient of an objective , where the state depends on the parameters through an equation , such as a wave equation whose coefficients are . Instead of one simulation per parameter, it needs one forward solve for and one solve of the adjoint (transposed) equation for an adjoint state , and then (a theorem). The cost does not depend on the number of parameters. The adjoint model of data assimilation is a special case of the same idea: there the transpose of the tangent linear forecast model, run backward in time, gives the gradient with respect to the initial state. The adjoint-state method is the general form, for any parameters of the equation; in seismic imaging the parameters are the coefficients of the wave equation, and the gradient is a reverse-time migration of the residuals. Applied to the discrete equations, it is reverse-mode automatic differentiation done by hand.
In plain words
Suppose a simulation depends on a million numbers, such as the wave speed in each cell of the ground, and you want to know how a single score, the mismatch with the data, changes when each number changes. Trying each number one at a time would take a million simulations. The adjoint-state method gets all million answers from two runs. The first run is the normal simulation. The second run goes backward: it starts from the mismatch at the receivers and sends it back through the same physics, like playing the echoes in reverse. Where the backward run meets the forward run, it tells how much each cell is to blame for the mismatch.
When it applies
Setting. A state , parameters , a state equation that has a unique solution for each with invertible, and a smooth objective , for example with a receiver operator .
The theorem. Let solve the adjoint equation
Then .
Proof. Differentiate : . So with , which is the adjoint equation.
The same result follows from the Lagrangian : at the state and adjoint solutions, .
Time-dependent equations. For a time-stepping scheme, is block lower triangular in time, so is block upper triangular: the adjoint equation runs backward in time from a zero final state, with the data residuals as its source. For the wave equation , applied to is , so , a zero-lag correlation, the imaging condition.
Conditions. The method needs the transpose of the linearized state operator, so the equation must be differentiable in and , and the forward states must be available during the backward run. It gives the gradient of one scalar objective; for objectives it needs adjoint solves.
The template
ADJOINT-STATE-GRADIENT(m)- 1
u ← solution of F(u, m) = 0 ▷ one forward simulation; keep the states needed in L3 and L4 - 2
J ← h(u) - 3
λ ← solution of (∂F/∂u)ᵀ λ = (∂h/∂u)ᵀ ▷ one adjoint simulation; backward in time for time stepping - 4
g ← -(∂F/∂m)ᵀ λ ▷ for the wave equation, a correlation of λ with u_tt at every point - 5
return J, g
The holes are the state equation and its discretization (L1), the objective (L2), the adjoint solver (L3), which uses the transpose of the same discrete operator, and the parameter derivative (L4). Line L4 costs about one pass over the stored forward states.
Classic examples
A small linear system by hand. Let with , , and . At the state is and . The adjoint equation reads and , so . Since and pick the two diagonal entries, . Directly, gives and , the same.
Full-waveform inversion. The state is the discrete wavefield, the parameters are in every cell, and is the least-squares data misfit. The adjoint run is the transposed time-stepping scheme with the residuals injected at the receivers. The test of that page checks the gradient against finite differences to about (a measurement).
Reverse-time migration. With the misfit linearized about a background model, the gradient at is for Born modeling , which RTM computes. Migration is the first gradient of an inversion.
4D-Var. The parameters are the initial state of a forecast model; the adjoint state is computed by the adjoint model backward over the assimilation window.
Backpropagation. A layered network is a state equation ; the backward pass is its adjoint, and the weight gradient is the product of the adjoint state and the forward activations.
Variations
- Discrete or continuous adjoint. Transposing the discrete scheme (discretize, then optimize) gives the exact gradient of the discrete objective. Deriving the continuous adjoint equation and discretizing it (optimize, then discretize) gives an approximation that converges as the grid is refined, but may not pass a gradient check.
- Frequency domain. For the time-harmonic wave equation , the adjoint is the conjugate transpose system, and one factorization of serves both the forward and the adjoint solves.
- Checkpointing. Store the forward states only at checkpoints and recompute between them during the backward run; with checkpoints the recomputation cost grows by a factor for time steps, the binomial schedule of automatic differentiation.
- Second-order adjoints. A second forward and adjoint pair gives a Hessian-vector product, for Newton and Gauss-Newton methods.
- Many sources. For several shots the objective is a sum, so the gradient is the sum of the gradients of each shot, each with its own forward and adjoint runs.
Pitfalls
- Mismatched discretizations. Using a different scheme for the adjoint run than the transpose of the forward scheme in line L3 gives a gradient that is wrong by a discretization error, and line searches fail near the optimum. Check the gradient against finite differences on a small case.
- The wrong end condition. The adjoint of a time-stepping scheme starts from zero at the final time and runs backward. Starting it at time zero, or forward, gives nonsense.
- Transpose of a variable coefficient. For , the transpose of is , so the adjoint state gets before . The scaled state satisfies the same recursion with after , as on the full-waveform inversion page. Mixing the two forms is exact only for constant .
- Memory. Line L4 needs the forward field at every time of the backward run. Storing all of it is often too large in 3D; use checkpointing or boundary storage.
- Nonsmooth objectives. The method gives the gradient of a differentiable ; for an misfit or a shock in the state, the gradient is not defined everywhere.
Exercises
- Derive the adjoint equation for from the Lagrangian and check it on the example.
- For the 1D scheme , write all time steps as one block lower-triangular system and derive the backward recursion of the adjoint state.
- Count the solves needed for the gradient of with parameters by forward finite differences, by forward sensitivities, and by the adjoint state.
References
- R.-E. Plessix, A review of the adjoint-state method for computing the gradient of a functional with geophysical applications, Geophysical Journal International 167(2), 2006, 495 to 503, the Lagrangian derivation of the adjoint state and its use for the wave equation in the time and frequency domains
- Guy Chavent, Identification of functional parameters in partial differential equations, in Identification of Parameters in Distributed Systems, R. E. Goodson and M. Polis (eds.), ASME, 1974, pages 31 to 48, the adjoint-state computation of the gradient for parameter identification in partial differential equations
- Albert Tarantola, Inversion of seismic reflection data in the acoustic approximation, Geophysics 49(8), 1984, 1259 to 1266, the gradient of the waveform misfit by back-propagation of the residuals
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag JVNKSY Edit this page History Report an error Markdown