Type at least 2 letters. Enter opens the first result, Esc closes.

    Quick recap

    The key takeaways of every lesson on one page. Read it in ten minutes to refresh the whole track; open a lesson when a point feels unclear.

    01 Reverse-mode autodiff

    • The derivative of FF at xx is a linear map dx↦J dxdx \mapsto J\,dx. The JVP pushes a direction forward (v↦Jvv \mapsto Jv); the VJP pulls a cotangent back (yˉ↦J⊤yˉ\bar y \mapsto J^\top \bar y).
    • The VJP is defined by ⟨yˉ,Jv⟩=⟨xˉ,v⟩\langle \bar y, J v\rangle = \langle \bar x, v\rangle for all vv. To derive one: write dydy, then move everything in ⟨yˉ,dy⟩\langle \bar y, dy\rangle away from dxdx.
    • Key VJPs: C=ABC = AB gives Aˉ=CˉB⊤\bar A = \bar C B^\top, Bˉ=A⊤Cˉ\bar B = A^\top \bar C; X=A−1BX = A^{-1}B gives Bˉ=A−⊤Xˉ\bar B = A^{-\top}\bar X, Aˉ=−BˉX⊤\bar A = -\bar B X^\top; y=log⁡∣det⁡A∣y = \log\lvert\det A\rvert gives Aˉ=yˉ A−⊤\bar A = \bar y\,A^{-\top}.
    • Reverse mode visits the tape in reverse order and adds the cotangents of a value that is used more than once (fan-out). It is back substitution on a triangular system.
    • A full m×nm \times n Jacobian needs nn forward passes or mm reverse passes, each a small constant times the cost of FF. For a scalar loss, one reverse pass gives the whole gradient.
    • Reverse mode pays in memory: the tape keeps every intermediate value a VJP needs.
    • Check gradients in float64 with central differences in a random direction, with h≈ε1/3≈10−5h \approx \varepsilon^{1/3} \approx 10^{-5}; a bug shows as an error floor that does not move with hh.

    02 Time stepping and stiffness

    • A one-step method has order pp if its local truncation error is O(hp)O(h^p); consistent + stable gives a global error O(hp)O(h^p). Measure pp as the slope of log⁡e\log e against log⁡h\log h.
    • On the test equation y′=λyy' = \lambda y a method multiplies yy by R(z)R(z) per step, z=hλz = h\lambda. It is stable at zz if ∣R(z)∣≤1\lvert R(z)\rvert \le 1.
    • R(z)=1+zR(z) = 1 + z (forward Euler), 1/(1−z)1/(1 - z) (backward Euler), (1+z/2)/(1−z/2)(1 + z/2)/(1 - z/2) (trapezoid / Crank–Nicolson). Forward Euler on the real axis: −2≤hλ≤0-2 \le h\lambda \le 0.
    • Every explicit method has a bounded stability region. A-stable: the whole left half-plane is stable. L-stable: also R(−∞)=0R(-\infty) = 0 (backward Euler yes, Crank–Nicolson no).
    • For a system, every hλih\lambda_i (eigenvalues of the Jacobian) must lie in the stability region. For explicit diffusion this gives Δt≤Δx2/(2ν)\Delta t \le \Delta x^2/(2\nu) in 1-D.
    • CFL condition: the numerical domain of dependence must contain the exact one; for upwind advection Co=cΔt/Δx≤1\mathrm{Co} = c\Delta t/\Delta x \le 1. It is necessary, not sufficient.
    • A problem is stiff when stability, not accuracy, sets the step. Then use implicit, IMEX or exponential methods.

    03 Adjoints and neural ODEs

    • The adjoint ODE is λ′=−Ju⊤λ\lambda' = -J_u^\top\lambda with the final condition λ(T)=∇ℓ(u(T))\lambda(T) = \nabla\ell(u(T)), solved backward in time; then dL/du0=λ(0)dL/du_0 = \lambda(0) and dL/dp=∫0TJp⊤λ dtdL/dp = \int_0^T J_p^\top\lambda\,dt.
    • The adjoint method costs about one extra (backward) solve for any number of parameters; finite differences cost 2np2n_p solves and forward sensitivities (S′=JuS+JpS' = J_uS + J_p) about npn_p.
    • A residual network xk+1=xk+hf(xk,θ)x_{k+1} = x_k + h f(x_k, \theta) is forward Euler for the neural ODE u′=fθ(u)u' = f_\theta(u); the adjoint method is backpropagation in time.
    • The discrete adjoint (backprop through the solver steps, discretize-then-optimize) is the exact gradient of the computed loss; the continuous adjoint (optimize-then-discretize) differs from it by O(hq)O(h^q).
    • Backsolve re-creates uu backward with O(1)O(1) memory, but every mode that decays forward grows backward, so it fails for damped or stiff problems; the adjoint equation itself is stable.
    • Uniform checkpointing stores CC states and recomputes the rest; memory ≈C+N/C\approx C + N/C is smallest at C=NC = \sqrt N, for less than one extra forward pass, and the gradient is unchanged.
    • ODE trajectories cannot cross, so a 1D neural ODE can only learn increasing maps; augmented neural ODEs add dimensions.

    04 Inverse problems and seismic imaging

    • An inverse problem recovers a model mm from data d=F(m)+ed = F(m) + e. It is ill-posed when a solution fails to exist, to be unique, or to depend stably on the data (Hadamard); most inverse problems in science fail stability.
    • For linear G=∑iσiuivi⊤G = \sum_i \sigma_i u_iv_i^\top, the naive solution ∑i(ui⊤d/σi) vi\sum_i (u_i^\top d/\sigma_i)\,v_i divides the noise by σi\sigma_i, so small singular values make it useless; the discrete Picard condition says ∣ui⊤d∣|u_i^\top d| must decay faster than σi\sigma_i.
    • Tikhonov regularization min⁡∥Gm−d∥2+α2∥m∥2\min\|Gm - d\|^2 + \alpha^2\|m\|^2 multiplies each component by the filter factor fi=σi2/(σi2+α2)f_i = \sigma_i^2/(\sigma_i^2 + \alpha^2), which is 12\tfrac12 at σi=α\sigma_i = \alpha; truncated SVD uses fi∈{0,1}f_i \in \{0, 1\}.
    • Choose α\alpha with the discrepancy principle (∥Gmα−d∥≈nd σ\|Gm_\alpha - d\| \approx \sqrt{n_d}\,\sigma), the corner of the L-curve, or GCV.
    • Tikhonov is the MAP estimate for noise N(0,σ2I)\mathcal N(0, \sigma^2 I) and prior N(0,(σ2/α2)I)\mathcal N(0, (\sigma^2/\alpha^2) I); the posterior covariance is σ2(G⊤G+α2I)−1\sigma^2(G^\top G + \alpha^2 I)^{-1}, and with general Gaussians the cost is 3D-Var.
    • Gauss–Newton solves (JF⊤JF)δ=−JF⊤r(J_F^\top J_F)\delta = -J_F^\top r at each step; in earthquake location the station geometry sets the conditioning of JF⊤JFJ_F^\top J_F and the shape of the uncertainty ellipse.
    • The adjoint-state method gives ∂J/∂mk=λ⊤(∂A/∂mk)u\partial J/\partial m_k = \lambda^\top(\partial A/\partial m_k)u with A⊤λ=−∇ujA^\top\lambda = -\nabla_u j: one forward and one adjoint solve per source, for any number of parameters. For FWI, ∇mJ=∫0Tλ utt dt\nabla_m J = \int_0^T\lambda\,u_{tt}\,dt.
    • FWI cycle-skips when the predicted arrivals are wrong by more than about half a period; inverting low frequencies first widens the basin of the correct model.

    05 Chaos, DMD and SINDy

    • A fixed point is classified by the eigenvalues of the Jacobian there: real parts decide growth or decay, imaginary parts decide rotation. Lorenz-63 has three fixed points, and all are unstable.
    • The Lyapunov exponents are λi=lim⁡t→∞1tln⁡si(M(t))\lambda_i = \lim_{t\to\infty}\frac1t\ln s_i(M(t)) for the tangent propagator MM. A bounded system with λ1>0\lambda_1 > 0 is chaotic; for Lorenz-63, λ=(0.906,0,−14.572)\lambda = (0.906, 0, -14.572).
    • The sum of the Lyapunov exponents is the time average of tr⁡J\operatorname{tr}J (Liouville's formula), and a flow that does not stop at a fixed point has one zero exponent.
    • An error reaches the size Δ\Delta after Tp=λ1−1ln⁡(Δ/δ0)T_p = \lambda_1^{-1}\ln(\Delta/\delta_0): a 10 times smaller starting error adds only ln⁡(10)/λ1\ln(10)/\lambda_1 of forecast time.
    • The Koopman operator (Kg)(u)=g(F(u))(\mathcal Kg)(u) = g(F(u)) is linear on observables even when FF is not; a Koopman eigenfunction evolves as φ(uk)=μkφ(u0)\varphi(u_k) = \mu^k\varphi(u_0). Chaotic systems have no exact finite Koopman-invariant subspace.
    • Exact DMD fits A=X′X+A = X'X^+ through a rank-rr SVD without forming AA; its modes are eigenvectors of AA, and each eigenvalue μ\mu gives the growth rate ln⁡∣μ∣/Δt\ln|\mu|/\Delta t and the angular frequency arg⁡μ/Δt\arg\mu/\Delta t.
    • SINDy writes X˙≈Θ(X)Ξ\dot X \approx \Theta(X)\Xi with a sparse Ξ\Xi and finds it by sequentially thresholded least squares; the threshold must lie between the largest spurious and the smallest true coefficient.

    06 Data assimilation

    • Data assimilation is Bayes' rule: the analysis (posterior) is proportional to forecast (prior) × observation likelihood. For one variable, xa=xf+K(y−xf)x^a = x^f + K(y - x^f) with K=Pf/(Pf+R)K = P^f/(P^f + R) and 1/Pa=1/Pf+1/R1/P^a = 1/P^f + 1/R.
    • The Kalman update follows from Gaussian conditioning: K=PfH⊤(HPfH⊤+R)−1K = P^fH^\top(HP^fH^\top + R)^{-1}, xa=xf+K(y−Hxf)x^a = x^f + K(y - Hx^f), Pa=(I−KH)PfP^a = (I - KH)P^f. KK and PaP^a do not depend on the value of yy.
    • An unobserved variable changes only through its forecast covariance with the observed quantities.
    • The Kalman filter alternates the forecast step xkf=Mxk−1ax^f_k = Mx^a_{k-1}, Pkf=MPk−1aM⊤+QP^f_k = MP^a_{k-1}M^\top + Q and the analysis step; it is exact for linear-Gaussian models, but it is too costly for n∼108n \sim 10^8.
    • The stochastic EnKF uses the sample covariance of NN members and perturbed observations (without them the analysis spread misses KRK⊤KRK^\top); its increments lie in at most N−1N - 1 directions.
    • Localisation (ρ∘Pf\rho \circ P^f) removes spurious long-range correlations and raises the rank; inflation (λ2Pf\lambda^2P^f) fixes underdispersion but keeps the span and the correlations.
    • 3D-Var and 4D-Var compute the MAP estimate; for linear models the 3D-Var minimum is the Kalman mean and the Hessian is (Pa)−1(P^a)^{-1}.
    • The 4D-Var gradient is B−1(x0−xb)+λ0B^{-1}(x_0 - x^b) + \lambda_0 from one backward sweep λj=Mj⊤λj+1+fj\lambda_j = M_j^\top\lambda_{j+1} + f_j: one forward and one adjoint run, whatever the size of the state.

    07 Gaussian processes and UQ

    • A Gaussian process is a distribution over functions: any finite set of values is jointly Gaussian with covariance k(xi,xj)k(x_i, x_j). The length scale ℓ\ell sets how fast the function varies; σf2\sigma_f^2 sets its size.
    • GP posterior: f∗∣y∼N(K∗⊤K−1y,  K∗∗−K∗⊤K−1K∗)f_* \mid y \sim \mathcal N(K_*^\top K^{-1}y,\; K_{**} - K_*^\top K^{-1}K_*) with K=Kf+σn2IK = K_f + \sigma_n^2 I. It is Gaussian conditioning, and its covariance does not depend on yy.
    • A new measurement y∗y_* has variance Var⁡[f∗]+σn2\operatorname{Var}[f_*] + \sigma_n^2; intervals without σn2\sigma_n^2 are too narrow.
    • Compute with one Cholesky factor K=LL⊤K = LL^\top: α=L⊤\(L\y)\alpha = L^\top\backslash(L\backslash y), Σ∗=K∗∗−V⊤V\Sigma_* = K_{**} - V^\top V with V=L\K∗V = L\backslash K_*, and log⁡det⁡K=2∑ilog⁡Lii\log\det K = 2\sum_i\log L_{ii}. Never form K−1K^{-1} or det⁡K\det K.
    • Log marginal likelihood =−12y⊤K−1y−12log⁡det⁡K−n2log⁡2π= -\tfrac12 y^\top K^{-1}y - \tfrac12\log\det K - \tfrac n2\log 2\pi (data fit, complexity, constant). Its gradient is 12tr⁡((αα⊤−K−1) ∂K/∂θj)\tfrac12\operatorname{tr}((\alpha\alpha^\top - K^{-1})\,\partial K/\partial\theta_j); it can have several local maxima.
    • A scoring rule is proper when the honest forecast minimises the expected score. The CRPS =E∣X−y∣−12E∣X−X′∣= \mathbb E|X - y| - \tfrac12\mathbb E|X - X'| is strictly proper, has the units of yy, and equals the absolute error for a point forecast.
    • Calibration: PIT values F(y)F(y) are uniform; a U shape means too narrow, a hump means too wide. Coverage checks several levels. The aim is maximum sharpness subject to calibration.

    08 Spectral methods and FNO

    • On a periodic grid, d/dxd/dx is multiplication by ikik in Fourier space; the spectral derivative is ifft⁡(ik fft⁡(u))\operatorname{ifft}(ik\,\operatorname{fft}(u)), with the Nyquist mode set to zero for odd derivatives.
    • Spectral accuracy: for analytic periodic functions the error falls like e−an/2e^{-an/2}, faster than any power of nn; with finitely many derivatives only like a power of 1/n1/n.
    • Aliasing: on nn points, modes kk and k+qnk + qn have the same samples, so u^k/n=∑qck+qn\hat u_k/n = \sum_q c_{k+qn}.
    • Orszag's 2/3 rule: for a quadratic term, keep ∣k∣≤K\lvert k\rvert \le K with 3K<n3K < n; then the pseudo-spectral product is exact on the kept modes.
    • Dealiased pseudo-spectral Burgers conserves energy for ν=0\nu = 0 and dissipates it for ν>0\nu > 0, like the PDE; aliasing can create energy and blow up an under-resolved run.
    • Cole–Hopf, u=−2νϕx/ϕu = -2\nu\phi_x/\phi, turns viscous Burgers into the heat equation and gives exact test solutions.
    • An FNO Fourier layer multiplies the lowest kmax⁡k_{\max} modes by learned matrices RkR_k; its weights do not depend on nn.
    • The Fourier layer is exactly discretisation-invariant for band-limited input; pointwise activations alias, so the full FNO is only approximately invariant.

    09 Spherical harmonics and SFNO

    • A latitude–longitude grid is not a periodic image: latitude is not periodic, and the rows near the poles hold many points on a small area.
    • The real spherical harmonics YlmY_l^m (l≥0l \ge 0, −l≤m≤l-l \le m \le l) are orthonormal on the sphere; YlmY_l^m has ∣m∣|m| meridian nodal lines and l−∣m∣l - |m| latitude nodal lines.
    • Spherical harmonics are eigenfunctions of the Laplacian: ∇2Ylm=−l(l+1)Ylm\nabla^2 Y_l^m = -l(l+1)Y_l^m on the unit sphere, −l(l+1)/a2-l(l+1)/a^2 on radius aa; so derivatives, Poisson solves and diffusion are multiplications per degree.
    • The triangular truncation TNT_N has (N+1)2(N + 1)^2 real coefficients and the same resolution everywhere on the sphere.
    • Compute Pˉlm\bar P_l^m with the normalised three-term recursion, never with factorials.
    • A KK-node Gauss–Legendre rule is exact up to degree 2K−12K - 1; with N+1N + 1 Gauss latitudes and 2N+12N + 1 longitudes, the SHT (FFT in longitude, then Legendre quadrature) is exact for TNT_N fields.
    • A rotation maps the degree-ll coefficients by an orthogonal matrix Dl(R)D^l(R); so the power spectrum ElE_l is rotation-invariant, and a filter clc_l that depends only on ll commutes with rotations.
    • The SFNO layer is the FNO layer with the SHT: a learned channel matrix RlR_l per degree, independent of mm, plus a pointwise skip and activation.

    10 Equivariant networks

    • A map is equivariant if f(ρin(g)x)=ρout(g)f(x)f(\rho_{\text{in}}(g)x) = \rho_{\text{out}}(g)f(x) for all gg; energy is E(3)-invariant and forces are E(3)-equivariant, because the gradient of an invariant function is equivariant.
    • Translations are handled by using only relative positions xj−xix_j - x_i; the real work is the group O(3)O(3) = rotations plus the inversion.
    • The irreps of SO(3)SO(3) are the degrees l=0,1,2,…l = 0, 1, 2, \dots with dimension 2l+12l + 1; O(3)O(3) adds a parity: 0e scalar, 0o pseudoscalar, 1o vector, 1e pseudovector, 2e symmetric traceless matrix.
    • The real Wigner-D matrix is defined by Yl(Rx^)=Dl(R)Yl(x^)Y_l(R\hat x) = D^l(R)Y_l(\hat x); it is an orthogonal representation, and D1(R)=RD^1(R) = R in the (x,y,z)(x, y, z) order.
    • Schur's lemma: an equivariant linear map between different irreps is zero, and between equal (real SO(3)SO(3)) irreps it is λI\lambda I; so equivariant linear layers only mix channels within each degree and parity.
    • Clebsch–Gordan: Dl1⊗Dl2=⨁L=∣l1−l2∣l1+l2DLD^{l_1} \otimes D^{l_2} = \bigoplus_{L=|l_1-l_2|}^{l_1+l_2} D^L, parities multiply, and two vectors give 1⊗1=0⊕1⊕21 \otimes 1 = 0 \oplus 1 \oplus 2 (dot, cross, symmetric traceless).
    • Nonlinearities act on scalars; higher degrees are multiplied by invariant gates σ(s)\sigma(s) or by functions of their norm.
    • Test equivariance with random Q∈O(3)Q \in O(3) of both determinants and random shifts; an exact model gives errors at rounding level, and the test must be able to fail.

    11 PINNs and failure modes

    • PINN loss: L=1Nr∑irθ(xi,ti)2+λic1N0∑j(uθ(xj,0)−g(xj))2+λbcLbcL = \frac1{N_r}\sum_i r_\theta(x_i, t_i)^2 + \lambda_{ic}\frac1{N_0}\sum_j(u_\theta(x_j, 0) - g(x_j))^2 + \lambda_{bc}L_{bc}, with the residual computed by automatic differentiation with respect to the inputs.
    • Second derivatives need nested reverse sweeps (create_graph=True) and a smooth activation; ReLU gives uxx=0u_{xx} = 0.
    • For advection, ∥e(t)∥≤∥e(0)∥+∫0t∥r(s)∥ ds\lVert e(t)\rVert \le \lVert e(0)\rVert + \int_0^t\lVert r(s)\rVert\,ds: a small residual guarantees a small error, so a failed PINN is a training failure, not a capacity failure.
    • At large β\beta the residual term grows like β2\beta^2 and the zero field has a far lower loss (λic/2\lambda_{ic}/2) than the frozen initial condition (β2/2\beta^2/2).
    • Spectral bias: gradient descent fits low frequencies first, so fast oscillations in tt are learned slowly.
    • Fixes: curriculum in β\beta, time marching over short windows, and causal weights wi=exp⁡(−ε∑k<iLr(tk))w_i = \exp(-\varepsilon\sum_{k<i}L_r(t_k)) treated as constants.
    • For a clean forward problem a classical solver is far more accurate and cheaper; PINNs suit inverse problems with sparse data and a known PDE.
    • Data misfit plus residual penalty is weak-constraint 4D-Var with the network as the trajectory.

    12 SDEs and Fokker–Planck

    • Brownian motion has independent increments Wt+h−Wt∼N(0,h)W_{t+h} - W_t \sim \mathcal N(0, h). Its quadratic variation ∑(ΔW)2\sum(\Delta W)^2 tends to TT while its total variation is infinite; in short, (dW)2=dt(dW)^2 = dt.
    • Euler–Maruyama: Xn+1=Xn+a h+b ΔWnX_{n+1} = X_n + a\,h + b\,\Delta W_n with the coefficients at the left point; this defines the Itô SDE dX=a dt+b dWdX = a\,dt + b\,dW.
    • Itô's lemma: f(X,t)f(X, t) is an Itô process with drift ft+afx+12b2fxxf_t + a f_x + \tfrac12 b^2 f_{xx} and diffusion coefficient bfxb f_x. The term 12b2fxx\tfrac12 b^2f_{xx} is the Itô correction.
    • GBM dX=μX dt+σX dWdX = \mu X\,dt + \sigma X\,dW has Xt=x0e(μ−σ2/2)t+σWtX_t = x_0e^{(\mu - \sigma^2/2)t + \sigma W_t}: mean growth rate μ\mu, median growth rate μ−σ2/2\mu - \sigma^2/2.
    • The OU process dX=−θX dt+σ dWdX = -\theta X\,dt + \sigma\,dW is Gaussian with mean x0e−θtx_0e^{-\theta t} and variance σ22θ(1−e−2θt)\frac{\sigma^2}{2\theta}(1 - e^{-2\theta t}); its stationary law is N(0,σ2/2θ)\mathcal N(0, \sigma^2/2\theta).
    • Fokker–Planck: ∂tp=−∂x(ap)+12∂xx(b2p)=−∂xJ\partial_t p = -\partial_x(ap) + \tfrac12\partial_{xx}(b^2p) = -\partial_x J; stationary densities have zero flux, and dX=−U′ dt+2 dWdX = -U'\,dt + \sqrt2\,dW has the Gibbs density p∝e−Up \propto e^{-U}.
    • Euler–Maruyama has strong order 1/2 (1 for additive noise) and weak order 1; Milstein adds 12bbx((ΔW)2−h)\tfrac12 b b_x((\Delta W)^2 - h) and has strong order 1.

    13 Score matching and diffusion

    • The score ∇xlog⁡p\nabla_x\log p points toward high density and does not depend on the normalising constant of pp.
    • Denoising score matching: JDSM=E∥sθ(x0+σε)+ε/σ∥2=JESM+CJ_{\text{DSM}} = E\|s_\theta(x_0 + \sigma\varepsilon) + \varepsilon/\sigma\|^2 = J_{\text{ESM}} + C, because the marginal score is the posterior mean of the conditional score; the minimum C>0C > 0 is not zero.
    • Tweedie's formula: E[x0∣x]=x+σ2∇log⁡pσ(x)E[x_0 \mid x] = x + \sigma^2\nabla\log p_\sigma(x); learning to denoise and learning the score are the same task.
    • Noising SDE dx=f dt+g dWdx = f\,dt + g\,dW: VE (f=0f = 0, here g2=2tg^2 = 2t, noise level σ=t\sigma = t) and VP (an OU process); the marginals ptp_t are the data convolved with a Gaussian.
    • Reverse-time SDE (Anderson 1982): dx=[f−g2∇log⁡pt] dt+g dWˉdx = [f - g^2\nabla\log p_t]\,dt + g\,d\bar W, run from t=Tt = T to 00, has the same marginals ptp_t.
    • Probability-flow ODE: dx/dt=f−12g2∇log⁡ptdx/dt = f - \tfrac12 g^2\nabla\log p_t has the same marginals; it is deterministic, invertible and gives exact likelihoods.
    • Both samplers follow from writing the Fokker–Planck equation as a continuity equation; any noise level g~\tilde g between them also works.
    • In practice: Euler–Maruyama for the SDE, Heun (second order) for the ODE, a geometric grid in σ\sigma, and a start from N(0,T2I)\mathcal N(0, T^2I).

    14 Flow matching and OT

    • Flow matching learns the velocity utu_t of an ODE from noise (t=0t = 0) to data (t=1t = 1) by regression on the conditional target x1−x0x_1 - x_0 along straight lines xt=(1−t)x0+tx1x_t = (1 - t)x_0 + tx_1; no ODE is solved during training.
    • Marginalization trick: ut(x)=E[x1−x0∣xt=x]u_t(x) = \mathbb E[x_1 - x_0 \mid x_t = x] generates the path ptp_t, and the CFM loss equals the FM loss plus a constant V≥0V \ge 0 (the conditional variance), so both have the same gradients.
    • With an independent coupling, lines cross and the learned paths bend; for noise N(0,1)\mathcal N(0, 1) and data ±2\pm 2 one Euler step sends every sample to 00.
    • Rectified flow (re-pairing Z0Z_0 with the flow's own end point Z1Z_1) does not increase any convex transport cost; for the squared cost the drop is S+VS + V, and reflow straightens the paths.
    • 1D optimal transport is sorting; for Gaussians, W22=∥m1−m2∥2+tr⁡(S1+S2−2(S11/2S2S11/2)1/2)W_2^2 = \lVert m_1 - m_2\rVert^2 + \operatorname{tr}\big(S_1 + S_2 - 2(S_1^{1/2}S_2S_1^{1/2})^{1/2}\big) (Bures).
    • Entropic OT has the plan Pij=e(fi+gj−Cij)/εP_{ij} = e^{(f_i + g_j - C_{ij})/\varepsilon}; Sinkhorn alternates row and column scalings (log domain for small ε\varepsilon), and its cost is above the exact one by at most εmin⁡(H(a),H(b))\varepsilon\min(H(a), H(b)).
    • Pairs of an optimal plan for the squared cost never meet at the same time, so OT paths are straight and one Euler step is exact; minibatch OT moves the coupling part of the way toward this.

    15 Flow matching on the sphere

    • The tangent plane of S2S^2 at xx is {v:x⋅v=0}\{v : x \cdot v = 0\}, with the projection Px=I−xx⊤P_x = I - xx^\top; the geodesic distance is d(x,y)=arccos⁡(x⋅y)d(x, y) = \arccos(x \cdot y), and geodesics are great circles at constant speed.
    • exp⁡x(v)=cos⁡∥v∥ x+sin⁡∥v∥ v/∥v∥\exp_x(v) = \cos\lVert v\rVert\,x + \sin\lVert v\rVert\,v/\lVert v\rVert, and log⁡x(y)=ω u/∥u∥\log_x(y) = \omega\,u/\lVert u\rVert with ω=arccos⁡(x⋅y)\omega = \arccos(x\cdot y) and u=y−(x⋅y)xu = y - (x\cdot y)x; they are inverse for ∥v∥<π\lVert v\rVert < \pi.
    • log⁡x\log_x is undefined at the antipode −x-x (the cut locus of xx), and its direction jumps near it.
    • The geodesic conditional path xt=exp⁡x0(tlog⁡x0x1)x_t = \exp_{x_0}(t\log_{x_0}x_1) is slerp, and its velocity is log⁡xt(x1)/(1−t)\log_{x_t}(x_1)/(1 - t), with constant speed d(x0,x1)d(x_0, x_1).
    • The Riemannian CFM loss regresses a tangent model Pxnet⁡θP_x\operatorname{net}_\theta on log⁡xt(x1)/(1−t)\log_{x_t}(x_1)/(1 - t); it has the same gradient as Riemannian flow matching, needs no simulation on the sphere, and is the CFM of lesson 14 in Rd\R^d.
    • Plain Euler steps leave the sphere (∥x+hv∥2=1+h2∥v∥2\lVert x + hv\rVert^2 = 1 + h^2\lVert v\rVert^2); exponential-map steps or projected steps (a retraction) keep samples on it.

    16 ML weather and climate models

    • An ML weather model learns the map xt→xt+6hx_t \to x_{t + 6\text{h}} from reanalysis data (ERA5, made with 4D-Var) and rolls it out to 10–15 days; families differ in how they move information on the sphere (mesh GNNs, 3D transformers, SFNO, hybrid physics–ML, diffusion ensembles).
    • Rollout fine-tuning trains on several autoregressive steps with the gradient through all of them, so the model learns to handle its own errors; it cannot remove chaotic error growth.
    • Forecast errors grow with lead time and level off: a single forecast near 2 σc\sqrt2\,\sigma_c, an ensemble mean near the climatological σc\sigma_c.
    • Theorem 1: E[(f−o)2∣I]=(f−μ)2+Var⁡(o∣I)\mathbb E[(f - o)^2 \mid \mathcal I] = (f - \mu)^2 + \operatorname{Var}(o \mid \mathcal I), so MSE training produces the smooth conditional mean, and a sharp realistic forecast pays the double penalty (twice the floor).
    • On a latitude–longitude grid, weight each row by its area, wi∝sin⁡ϕiu−sin⁡ϕil≈cos⁡ϕiw_i \propto \sin\phi_i^u - \sin\phi_i^l \approx \cos\phi_i; poleward of 60° are 33.6 % of the rows of the 0.25° grid but 13.4 % of the area.
    • The fair ensemble CRPS 1M∑∣xm−y∣−12M(M−1)∑m,n∣xm−xn∣\frac1M\sum|x_m - y| - \frac{1}{2M(M-1)}\sum_{m,n}|x_m - x_n| is unbiased for the CRPS of the member distribution; the standard 1/(2M2)1/(2M^2) version punishes small ensembles.
    • Theorem 2: for a perfect MM-member ensemble, skill² =M+1M= \frac{M+1}{M} spread², so spread/skill ≈M/(M+1)\approx \sqrt{M/(M+1)} (0.953 for M=10M = 10).
    • A fair comparison fixes the test year (WB2: 2020), the ground truth, the grid and regridding, the time convention and the units, and tests differences with paired scores and a block bootstrap.