Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Scientific machine learning

GeoStack · lens 4 of 5 · 1 December 2026

Abstract

A curriculum in five parts on the arc of James-A. Goulet’s Probabilistic Machine Learning for Civil Engineers: representation, the model, the problem, physics in the loop, and evaluation and decisions. Part II is what you believe before any data: how the uncertainty is held and which family holds it. Part III is what you compute once data arrive: the target (after Osvaldo Simeone’s split between estimation and learning, plus bilevel, plus the computation itself, after Hennig, Osborne and Kersting’s Probabilistic Numerics) and the method, from exact to approximate to amortized. Where the numerical-methods lens puts uncertainty on the computation, this one puts it on the world. The pipeline view, from data to evaluation, lives on the applications page.

describemathax
fitinferax, pyrox
physicsGeoNumerics
dataGeoStack (geotoolz)
assembleGeoModels
orchestratepipekit
dashed, numbered: off the shelf the lens expects, or no library yet
Dhanded to the data-engineering lens
Phas a probabilistic-numerics counterpart

I · Representation

Basesf=∑dzdϕdf = \sum_d z_d \phi_d, fixed ϕd\phi_dfunctax

Kernels1f=∑nθnk(⋅,xn)f = \sum_n \theta_n k(\cdot, \vect{x}_n)kernellib

Networksf=gnet(x;θ)f = g_\text{net}(\vect{x}; \gvect{\theta}), a learned basisgeonnax

II · The model · what you believe

Gaussian formsfour forms of one fieldmoment · precisionspectral · SDE

Beyond Gaussiansamples · transportimplicit simulatorsEnKF · gauss_flows

Families on NumPyro2GP, LGM, state space, BNN, extremespyrox-gp · -lgm · -ssm · -nnpyrox-xtreme · pyrox-gauss

III · The problem · what you compute

Target · what is unknown

Estimationx\vect{x} per instance, θ\gvect{\theta} fixedvardax · filteraxargminax · plumax

LearningDθ\gvect{\theta} once, over a datasetpipekit-trainpyrox · geonnax

Bilevelθ\gvect{\theta} through x⋆(θ)\vect{x}^\star(\gvect{\theta})argminax.adjointpipekit-cycle

The computation6probabilistic numericsno home

Method · exact → approximate → amortized

Exactclosed form: conditioning, Kalman, one solvegaussx · kernellib KRR

Approximate7MAP, Laplace · moment matching · VI · samplingargminax · vardax · pyrox · NUTSSMC and ABC missing

Amortized4a family learned once, one pass per instancevardax AmortizedPosterior · FourDVarNet

IV · Physics in the loop

Differentiable opsgridaxspectraldiffx

Hybrid modelsplumax · radtraxsesmax

V · Evaluate, decide

Scorersthe frameworkpipekit-evaluatekernellib MMD · HSIC

Skill scores3the scoresdiagnostix

Decisions5value of information, where to look nextno home

Part II is the model, which could be sampled before any data; Part III is the problem: a target, and a method that is exact, approximate or amortized. Decisions, probabilistic solvers and two rungs of the ladder have no library.

I · Representation

Before any probability, a function has to be written down with finitely many numbers: a field over space, a forward model, a closure. The representation decides which numbers those are and whether the function is linear in them, which in turn decides what is cheap to fit and what the uncertainty is placed on later. The three representations run from fixed to learned: a basis chosen in advance, a basis anchored at the data, and a basis that is itself learned.

Bases

A fixed set of functions, chosen before seeing the data, so the function is linear in its coefficients.

f(x)=∑d=1Dzzdϕd(x)f(\vect{x}) = \sum_{d=1}^{D_z} z_d \phi_d(\vect{x})

The DzD_z basis functions ϕd\phi_d are fixed, and only the coefficients zdz_d are fitted. functax holds Chebyshev, B-spline and Fourier bases, spherical harmonics and wavelets, with projection by least squares, Galerkin or a variational fit. Shelf: describe.

Kernels

A basis anchored at the data: one function per observation, centred on it by a kernel.

f(x)=∑n=1Nθnk(x,xn)f(\vect{x}) = \sum_{n=1}^{N} \theta_n k(\vect{x}, \vect{x}_n)

The kernel kk places one function at each of the NN data points xn\vect{x}_n, and the weights θn\theta_n are fitted. kernellib holds the kernels and the random Fourier and Nyström features, and its KernelPCA learns a basis from the data. Shelf: describe 1.

Networks

A basis that is itself learned, so the function is nonlinear in its parameters.

f(x)=gnet(x;θ)f(\vect{x}) = g_\text{net}(\vect{x}; \gvect{\theta})

The network gnetg_\text{net} has weights θ\gvect{\theta}, and both the features and their combination are fitted. geonnax holds the layers, positional encoders and neural operators. Shelf: describe.

II · The model: what you believe

The model is what you believe before any data arrive: a distribution you could sample from. It has two halves. A is how the uncertainty is held, which decides what Part III can compute cheaply; B is which family of models holds it. Expect the same belief to take several forms: a Matérn field is one model, held four ways.

Throughout, x∈RDx\vect{x} \in \mathbb{R}^{D_x} is the state or the input, y∈RDy\vect{y} \in \mathbb{R}^{D_y} the observations, z∈RDz\vect{z} \in \mathbb{R}^{D_z} a latent or the coefficients of a basis, θ∈RDθ\gvect{\theta} \in \mathbb{R}^{D_\theta} the parameters, ν∈RDν\gvect{\nu} \in \mathbb{R}^{D_\nu} the variational parameters, NN the number of data points, TT the number of time steps and NEN_{\mathcal{E}} the number of ensemble members.

A · How uncertainty is held: one Gaussian, four forms

One Gaussian can be stored by its covariance, its precision, its spectral weights or a Markov recursion; the distribution is the same in each, but each makes a different operation cheap.

Moment

The Gaussian held directly, by its mean and a dense covariance.

Σx=KXX∈RN×N\gmat{\Sigma}_x = \mat{K}_{XX} \in \mathbb{R}^{N \times N}

The covariance is the kernel matrix KXX\mat{K}_{XX} over the NN stacked points X∈RN×Dx\mat{X} \in \mathbb{R}^{N \times D_x}, and conditioning on data costs O(N3)\mathcal{O}(N^3). In the stack: gaussx operators and conditional, and kernellib kernels. Shelf: describe.

Precision

The Gaussian held by a sparse inverse covariance, built from a local differential operator.

(ℓ−2−∇s2)α/2x(s)=w(s)(\ell^{-2} - \nabla^2_{\vect{s}})^{\alpha/2} x(\vect{s}) = w(\vect{s})

The field xx at location s\vect{s} is driven by white noise ww, with length scale ℓ\ell and smoothness α\alpha; the operator is local, so the precision Λx\gmat{\Lambda}_x is sparse. In the stack: gaussx spde_precision and matern_spde_params, pyrox-gauss GMRFDistribution, and pyrox-lgm. Shelf: describe.

Spectral

The Gaussian held as weights on a basis drawn from its spectral density.

Σx≈ΦΦ⊤\gmat{\Sigma}_x \approx \gmat{\Phi} \gmat{\Phi}^\top

The N×DzN \times D_z feature matrix Φ\gmat{\Phi} has one column per spectral feature, so working with the covariance costs O(NDz2)\mathcal{O}(N D_z^2). In the stack: kernellib RandomFourierFeatures, LaplaceEigenfunctionFeatures (HSGP), SphericalHarmonicFeatures and NystromFeatures, and pyrox-nn HSGPFeatures. Shelf: describe.

State space

The Gaussian held as a Markov recursion in time, from a linear SDE.

dx(t)=Fcx(t)dt+Lcdb(t)\mathrm{d}\vect{x}(t) = \mat{F}_\text{c} \vect{x}(t) \mathrm{d}t + \mat{L}_\text{c} \mathrm{d}\vect{b}(t)

The drift Fc∈RDx×Dx\mat{F}_\text{c} \in \mathbb{R}^{D_x \times D_x} and the noise gain Lc∈RDx×Db\mat{L}_\text{c} \in \mathbb{R}^{D_x \times D_b} act on a Brownian motion b∈RDb\vect{b} \in \mathbb{R}^{D_b}, and a filter steps through TT times at O(T)\mathcal{O}(T). In the stack: gaussx MaternSDE, sde_autocovariance, kalman_filter and parallel_kalman_filter, and pyrox-ssm MarkovGPPrior. Shelf: describe.

A · Beyond the Gaussian

When the belief is not Gaussian it is held by draws, by a map from a simple distribution, or only by a simulator that produces draws.

Samples

The distribution held by an ensemble of draws, which allows any nonlinearity but has limited rank.

{x(e)}e∈E\{\vect{x}^{(e)}\}_{e \in \mathcal{E}}
rank(Σ^x)≤NE−1\mathrm{rank}(\hat{\gmat{\Sigma}}_x) \le N_{\mathcal{E}} - 1

The NEN_{\mathcal{E}} members carry any nonlinearity, but their covariance Σ^x\hat{\gmat{\Sigma}}_x spans at most NE−1N_{\mathcal{E}} - 1 directions. In the stack: gaussx ensemble_covariance and ensemble_kalman_gain, and pipekit-cycle EnKF; kernellib KernelDensity smooths samples into a density. Shelf: describe.

Transport

The distribution held by a map that pushes a simple distribution onto the one wanted.

x=gflow(z;θ)\vect{x} = g_\text{flow}(\vect{z}; \gvect{\theta})
z∼N(0,I)\vect{z} \sim \mathcal{N}(\vect{0}, \mat{I})

The map gflowg_\text{flow}, with parameters θ\gvect{\theta}, turns standard normal draws z\vect{z} into draws of x\vect{x}. In the stack: gauss_flows fit_gaussianization_flow and FlowGuide. Shelf: fit.

Implicit

Only a simulator: it draws data given parameters, but there is no density to evaluate.

y∼p(y∣θ)\vect{y} \sim p(\vect{y} \mid \gvect{\theta})

Draws of y\vect{y} given θ\gvect{\theta} are available; p(y∣θ)p(\vect{y} \mid \gvect{\theta}) itself is not. In the stack: plumax, sesmax and radtrax as simulators. Shelf: assemble.

B · What is modelled

The family is the model itself, and A is how it is held.

Families

The model families the stack offers, each of which can be held in more than one of the forms above: a Matérn GP is one family in all four Gaussian forms. In the stack, on NumPyro: pyrox-gp GPs, pyrox-lgm latent Gaussian models, pyrox-ssm state-space models, pyrox-nn Bayesian networks and pyrox-xtreme extremes; pyrox-gauss puts the distributions on gaussx. Shelf: fit 2.

III · The problem: what you compute from data

Once data arrive, the problem is two choices: the target, which unknown the data inform, and the method, how its posterior is computed. The targets follow Simeone’s split between estimation and learning, plus bilevel problems and the computation itself; the methods run from exact to approximate to amortized. Every target can be solved by every method, as Targets against methods shows.

Target: what is unknown

The target is a state per instance, parameters shared across a dataset, parameters learned through the estimates, or the result of a computation.

Estimation

The state of one instance, with the model fixed.

p(x∣y;θ)p(\vect{x} \mid \vect{y}; \gvect{\theta})
x⋆=argminx J(x;θ)\vect{x}^\star = \mathrm{argmin}_{\vect{x}} \ \mathcal{J}(\vect{x}; \gvect{\theta})

The posterior over x\vect{x} given the data y\vect{y}, or its mode, the minimiser of the cost J\mathcal{J}; the parameters θ\gvect{\theta} sit behind the semicolon, fixed. In the stack: vardax, filterax, argminax, and plumax per-plume inversions. In the ocean example it is the state, by 4D-Var; in the sources example it is QQ for one plume. Shelf: fit.

Learning

The parameters, learned once over a dataset.

p(θ∣D)p(\gvect{\theta} \mid \mathcal{D})
θ⋆=argminθ L(θ;D)\gvect{\theta}^\star = \mathrm{argmin}_{\gvect{\theta}} \ \mathcal{L}(\gvect{\theta}; \mathcal{D})

The posterior over θ\gvect{\theta} given the dataset D\mathcal{D}, or the minimiser of the loss L\mathcal{L}. In the stack: pipekit-train with geonnax, pyrox models and gauss_flows. In the ocean example it is an emulator; in the sources example, a detector. Shelf: fit D.

Bilevel

The parameters, learned through the estimates they produce.

θ⋆=argminθ L(θ;x⋆(θ))\gvect{\theta}^\star = \mathrm{argmin}_{\gvect{\theta}} \ \mathcal{L}(\gvect{\theta}; \vect{x}^\star(\gvect{\theta}))

The inner problem gives the estimate x⋆(θ)\vect{x}^\star(\gvect{\theta}), and the outer loss L\mathcal{L} scores it, so the gradient runs through the inner solve. In the stack: argminax.adjoint, pipekit-cycle ImplicitAdjoint, diffrax adjoints and vardax FourDVarNet. In the ocean example it is the background covariance or the model error, learned through the DA cycle; in the sources example, the dispersion parameters shared across plumes. Shelf: fit.

The computation

The result of a numerical method, inferred from the evaluations it made: a solve from matrix–vector products, an integral from function values, a derivative from nearby values, an ODE trajectory from vector-field evaluations. There is no probabilistic solver yet; the probabilistic-numerics counterparts are marked P on the numerical-methods page. Shelf: gap 6.

Method: how, under any target

The method computes the posterior over the target: in closed form, by a cheaper stand-in per instance, or by a stand-in learned once.

Exact

The posterior in closed form: Gaussian conditioning, the Kalman filter, one linear solve.

μx∣y=μx+ΣxyΣy−1(y−μy)\gvect{\mu}_{x \mid y} = \gvect{\mu}_x + \gmat{\Sigma}_{xy} \gmat{\Sigma}_y^{-1} (\vect{y} - \gvect{\mu}_y)
Σx∣y=Σx−ΣxyΣy−1Σxy⊤\gmat{\Sigma}_{x \mid y} = \gmat{\Sigma}_x - \gmat{\Sigma}_{xy} \gmat{\Sigma}_y^{-1} \gmat{\Sigma}_{xy}^\top

Conditioning a joint Gaussian on y\vect{y} needs one solve against Σyy\gmat{\Sigma}_{yy}; the Kalman filter does the same one time step at a time. Shelf: fit.

Approximate

A cheaper stand-in for the posterior, fitted for each instance.

q(x)≈p(x∣y;θ)q(\vect{x}) \approx p(\vect{x} \mid \vect{y}; \gvect{\theta})

The stand-in qq is a point and its curvature (MAP, Laplace, INLA), a projection (moment matching: EKF, UKF, EP, the EnKF), the best member of a family (variational), or draws (MCMC, SMC, ABC). Shelf: fit 7.

Amortized

One of those stand-ins, learned once over simulations and run in one pass per instance.

q(x∣y;ν)≈p(x∣y;θ)q(\vect{x} \mid \vect{y}; \gvect{\nu}) \approx p(\vect{x} \mid \vect{y}; \gvect{\theta})

The map from y\vect{y} to qq, with parameters ν\gvect{\nu}, is trained once and then costs one pass for each new y\vect{y}; it is the six-step cycle’s step 5. In the stack: vardax AmortizedPosterior and FourDVarNet, and pipekit-train. In the ocean example it is learned DA; in the sources example, a network from image to QQ. Shelf: fit 4.

IV · Physics in the loop

Physics enters as code that can be differentiated, so that gradients from Part III flow through it. Operators discretise the equations; hybrid models assemble those operators, learned parts and the observation model into one model that can be simulated, fitted and inverted.

Differentiable operators

The discretised pieces of the physics, all differentiable: stencils and spectral derivatives for the dynamics, and observation geometry and radiometry for the sensor. In the stack: gridax, spectraldiffx and radiomax. Shelf: physics.

Hybrid models

Whole models assembled from those operators, such as plume transport, radiative transfer and ocean dynamics, where learned parts can sit beside the physics and be trained through it. In the stack: plumax, radtrax and sesmax (sesmax_core.train). Shelf: assemble.

V · Evaluate, decide

The last part asks whether the result is good enough and what to do with it: scores against a reference, and decisions made under the posterior. Expect the scoring to exist and the deciding not to.

Scorers, skill scores

Scores that compare a result with a reference, from point errors to distances between whole distributions.

MMD2(p,q)=Exp,xp′∼p[k(xp,xp′)]−2Exp∼p,xq∼q[k(xp,xq)]+Exq,xq′∼q[k(xq,xq′)]\mathrm{MMD}^2(p, q) = \mathbb{E}_{\vect{x}_p, \vect{x}_p' \sim p}[k(\vect{x}_p, \vect{x}_p')] - 2 \mathbb{E}_{\vect{x}_p \sim p, \vect{x}_q \sim q}[k(\vect{x}_p, \vect{x}_q)] + \mathbb{E}_{\vect{x}_q, \vect{x}_q' \sim q}[k(\vect{x}_q, \vect{x}_q')]

The maximum mean discrepancy is zero only when pp and qq agree, for a characteristic kernel kk; it compares an emulator’s outputs with the simulator’s, or a synthetic world with the real one. pipekit-evaluate is the framework and diagnostix holds the scores; kernellib mmd_squared, hsic and cka compare distributions. Shelf: orchestrate 3.

Decisions

The action that is best under the posterior, and whether an extra observation is worth making.

a⋆=argmaxa∈A Ep(x∣y)[U(a,x)]a^\star = \mathrm{argmax}_{a \in \mathcal{A}}\ \mathbb{E}_{p(\vect{x} \mid \vect{y})}\left[U(a, \vect{x})\right]

Expected utility, the value of information, where to observe next and sequential decisions have no home in the stack yet; Decisions, after Goulet works them through below. Shelf: gap 5.

Targets against methods

Every target can be solved on every rung: exact, approximate, amortized. A cell names what exists at the pinned commits; an approximate or amortized cell names its family. Amortized is not a new family: it learns one of the approximate families once, so that each instance costs one pass. It is the six-step cycle’s step 5.

TargetExactApproximateAmortized
Estimationtoday gaussx conditional, kalman_filter, rts_smoother; vardax OptimalInterpolationMAP, Laplace today argminax laplace_mode; vardax 3D- and 4D-Var with LaplaceCovariance Moment matching today gaussx nonlinear_kalman_filter, UnscentedIntegrator, sigma_point_kalman_update; ensemble_kalman_gain, EnKF; pyrox-ssm ExpectationPropagationMarkov Variational pieces gaussx ELBO terms, NumPyro SVI; no per-instance example Sampling today plumax infer_emission_rate, NUTS per plume gap SMC, particle filters, ABC ⑦MAP today geonnax inverse maps, FourDVarNet’s learned solver Variational today vardax AmortizedPosterior Posterior estimation pieces gauss_flows conditioners; ConditionalFlowHead is a stub ⑦ Filtering gap learned filters
Learningtoday the exact evidence, maximised: gaussx log_marginal_likelihood; kernellib KRR, with Falkon and EigenPro solving it on a Nyström form or iterativelyMAP, Laplace, INLA today pipekit-train + geonnax; EnsembleMAP; fit_gaussianization_flow; pyrox-lgm inla; pyrox-nn last_layer_laplace Variational today pyrox-gp svgp_elbo, MeanFieldGuide, FullRankGuide, CVI; FlowGuide; EnsembleVI Sampling today pipekit-train NumPyro and BlackJAX adapters over pyrox-nn gap ABC for θ ⑦gap θ for a new dataset in one pass: neural processes, neural likelihood estimation ⑦
Bileveltoday hyperparameters through the Kalman evidence, markov_gp_factorMAP today argminax.adjoint, ImplicitAdjoint, optimize_prior_precision Variational today hyperparameters through the collapsed ELBO, svgp_elbo Sampling gap nested or pseudo-marginal samplingtoday FourDVarNet learns the solver and the prior together
The computationgap BayesCG, Bayesian quadrature, probabilistic finite differences, linear ODE filters ⑥; gaussx IntegratedWienerSDE and kalman_filter are most of an ODE filterPoint today every classical solver: its answer is the point estimate, with no uncertainty Moment matching gap nonlinear ODE filters ⑥pieces geonnax neural operators amortize a solve, as point answers with no uncertainty

Sequential is not a method. A Kalman filter is the exact rung on a state-space form; EKF, UKF and EP are approximate by moment matching; the EnKF is moment matching with samples; a particle filter is approximate by sampling (SMC); a learned filter is amortized. Amortizing the inverse is not emulating the forward model. plumax’s FootprintEmulator and pipekit-cycle’s NeuralForward replace the forward model and still need an estimation step after them; vardax’s AmortizedPosterior replaces the estimation step itself.

The seam: which form makes which method cheap

Part II fixes the form, Part III picks the method, and some pairings are much cheaper than others. One Matérn field shows why: the same Gaussian is dense as a moment, sparse as a precision, diagonal in a spectral basis and Markov in time.

One Matérn fieldlength scale ℓ\ell, smoothness α\alphathe same Gaussian, held four ways

MomentΣx=KXX\gmat{\Sigma}_x = \mat{K}_{XX}, densecondition: O(N3)\mathcal{O}(N^3)gaussx · kernellib

Precision(ℓ−2−∇s2)α/2x=w(\ell^{-2} - \nabla^2_{\vect{s}})^{\alpha/2} x = wsparse Λx\gmat{\Lambda}_xspde_precision

SpectralΣx≈ΦΦ⊤\gmat{\Sigma}_x \approx \gmat{\Phi} \gmat{\Phi}^\topO(NDz2)\mathcal{O}(N D_z^2)RFF · HSGP

State spacedx=Fcxdt+Lcdb\mathrm{d}\vect{x} = \mat{F}_\text{c} \vect{x} \mathrm{d}t + \mat{L}_\text{c} \mathrm{d}\vect{b}O(T)\mathcal{O}(T), in timeMaternSDE · kalman

Cheapest method per formspectral, state space: exactprecision: Laplace (INLA)moment: variational (SVGP)

One Matérn field, with length scale ℓ\ell and smoothness α\alpha, in the four Gaussian forms. Each makes a different computation cheap.

Form (II)Method (III)GivesIn the stack
State spaceexactKalman filter and smoother, O(T)gaussx kalman_filter, rts_smoother
State spaceapproximate: moment matchingEKF, UKF and EP; with samples, the EnKFnonlinear_kalman_filter, ExpectationPropagationMarkov, EnKF
Precisionapproximate: LaplaceINLApyrox-lgm inla
Momentapproximate: variationalSVGPpyrox-gp svgp_elbo
SpectralexactBayesian linear regression on features, O(N D_z²)kernellib features + gaussx conditional
Momentexactkernel ridge regression, the GP posterior meankernellib KRR; Falkon on a Nyström form
Transportapproximate: variationalflow guidesgauss_flows FlowGuide
Implicitapproximate: samplingABCgap ⑦
Implicitamortizedneural posterior estimationpieces ⑦

An approximation that changes the model belongs to Part II; one that changes the posterior belongs to Part III. Inducing points, a truncated spectral basis and a coarser grid change the model; Laplace, VI and MCMC change how its posterior is computed. SVGP does both: its inducing points are a form, its ELBO an approximate method.

Decisions, after Goulet

With aa an action from the set A\mathcal{A}, U(a,x)U(a, \vect{x}) its utility, y\vect{y} the data so far and ynew\vect{y}_\text{new} a candidate observation, the best action and the value of making the observation are

a⋆=argmaxa∈A Ep(x∣y)[U(a,x)]a^\star = \mathrm{argmax}_{a \in \mathcal{A}} \ \mathbb{E}_{p(\vect{x} \mid \vect{y})}\left[U(a, \vect{x})\right]
VoI(ynew)=Ep(ynew∣y)[max⁡aEp(x∣y,ynew)[U(a,x)]]−max⁡aEp(x∣y)[U(a,x)]\mathrm{VoI}(\vect{y}_\text{new}) = \mathbb{E}_{p(\vect{y}_\text{new} \mid \vect{y})}\left[\max_{a} \mathbb{E}_{p(\vect{x} \mid \vect{y}, \vect{y}_\text{new})}\left[U(a, \vect{x})\right]\right] - \max_{a} \mathbb{E}_{p(\vect{x} \mid \vect{y})}\left[U(a, \vect{x})\right]

VoI is never negative, so an observation is worth making when its value exceeds its cost. For methane: the action is to flag a site or not, the state includes the emission rate QQ (kg h⁻¹), and the candidate observation is a revisit; task the revisit when its value exceeds the cost of tasking. Over several steps the same question is a Markov decision process, which is where Goulet ends. Nothing in the stack computes either (note ⑤).

Where it doesn’t fit