Examples¶
All examples on GitHub —
examples/(clone, run, modify)
Runnable example scripts and notebooks live in the examples/ directory of
the repository. The notebooks under examples/notebooks/ (cards below)
are cell-by-cell tutorials and the easiest entry point; for a flat overview
of all of them see the home page gallery. Scripts for
workflows that don't fit a notebook (e.g. multi-process multi-GPU FWI) are
linked at the bottom of this page.
Notebooks (start here)¶
-

Hello · SWEEP
Smallest end-to-end SWEEP story in one notebook: parameters → model →
Acoustic()+PropTorch()→ one shot gather → one.backward()for a vp gradient → 5-line Adam loop. No external data. -

FWI · Acoustic · Marmousi
Load Marmousi from
sweep.datasets, build a 192×320 window, forward-model observed gathers, and invert the smooth start with Adam + MSE. Each phase is one cell. -

FWI · Elastic · Marmousi
Same skeleton, but the equation is
Elasticand the model is the(vp, vs, rho)triplet.vsandrhoare derived fromvpwith Poisson + Gardner relations so the example still runs with zero downloads. -

FWI · multiscale
Three-band frequency progression (3 → 6 → 12 Hz) of acoustic FWI on Marmousi 25 m. Each band feeds its final model into the next; loss drops monotonically across the chain and avoids cycle skipping.
-

DAS · Zhao vs Mu
Forward-model the same three-layer elastic medium with the two DAS formulations and compare the resulting strain-rate gathers side by side.
-

Wavefield · VTI + shear suppression
Run Duveneck (1st-order), Liang (2nd-order pseudo-acoustic), and Alkhalifah (η-acoustic) through the unified
AcousticAnisofactory on the canonical Duveneck Fig 2 setup; the trailing cell demonstrates the δ→ε disk taper that kills the pseudo-acoustic shear artefact. -

Wavefield · Elastic
Wavefield snapshots from three different stress-source loadings on a uniform elastic medium — explosion, vertical dipole, and pure shear — to visualize P/S excitation and radiation patterns.
-

Memory · strategies
Same forward + backward step run under five memory strategies (eager full vs. eager ckpt vs. c boundary-saving / chunk-ckpt / recursive-ckpt) with side-by-side peak-memory and wallclock charts.
-

RTM · Acoustic · Marmousi
Reverse-time migration on full 12.5 m Marmousi with a 15 Hz Ricker — background subtraction, near-offset mask, illumination compensation, and
solver.rtm(). Produces a clean reflectivity image in <3 s on 30 shots. -

Solver · hyperparameters
Side-by-side wavefield snapshots showing how the propagator's
spatial_order,abcn(PML width) andpml_typechoices visibly change boundary reflections and grid dispersion on a single shot. -

Wavefield · Elastic TTI
Rotated staggered-grid (
ElasticTTI)vzsnapshots across three tilt / azimuth cases — the Duveneck Fig 2 setup at full resolution with(ε, δ, γ, θ, φ)rotated symmetry axis. -

FWI · 3-D · Overthrust
Acoustic FWI on a 3-D Overthrust volume —
Acoustic3Dsolver, boundary-saving for memory, depth/inline/crossline slices of the recoveredvpcube vs ground truth. -

Multi-GPU · DDP vs 1 GPU
torchrun --nproc_per_node=Ndriver that shards shots across GPUs and syncs gradients viatorch.distributed. Hits 3.79× speedup on 4× V100 for Marmousi FWI compared to a single-GPU baseline. -

IFWI · SIREN coordinate network
Implicit FWI: a SIREN coordinate network outputs
vp(x, z)instead of a grid of free parameters; its weights are inverted by backprop through the propagator on Marmousi. -

Custom gradients · imaging condition
Register your own imaging condition — override the default correlation with a user-defined gradient kernel via the autograd hook and compare it to the built-in one.
-

Wavefield · irregular topography
Image-method irregular free-surface for acoustic & elastic 2-D — drape a non-flat surface along the top of the model and see how the topography reshapes the surface waves and primaries.
-

ADCIG · angle-domain image gathers
Angle-domain common-image gathers — decompose the migrated image by reflection angle; flat gathers indicate a correct migration velocity, curved ones reveal the error.
-

Elastic vector reflectivity
Forward-modeling validation of elastic vector-reflectivity (Soares & Sacchi 2025) — the formulation reproduced and checked against the reference.
-

FWI · VRZ · Marmousi
Acoustic variable-density (VRZ) FWI on Marmousi — vector reflectivity from impedance, inverted with the
AcousticVRZequation. -

Extending · add a new equation
Tutorial: add a brand-new wave equation to SWEEP — define its fields and time step, register it, and drive it through
PropTorchlike any built-in. -

FWI · boundary compression
storage_dtype(fp16/bf16/int8) shrinks the saved boundary wavefield while compute stays FP32. Marmousi FWI across the full{gpu, cpu, disk} × dtypematrix (compiled and eager) — identical convergence, plus a runtime GPU-memory breakdown. -

Sensitivity · Acoustic radiation
Scattered-wavefield snapshots of the partial-derivative virtual sources for the acoustic
(Vp, ρ)/(Vp, Iₚ)parameterizations — the angular sensitivity behind multiparameter trade-off. Reproduces Operto et al. (2013) Fig. 2. -

Sensitivity · Elastic radiation
Elastic
(Vp, Vs, ρ)P-P / P-S / S-S radiation patterns: the analytic Born kernel against sweep's Born-differenced numerics, the δln relative sizes (Vs/Vp ≈ 0.6), and scattered-wavefield snapshots. Cf. Operto Fig. 8(c,d) / Forgues & Lambaré.
Scripts¶
For workflows that don't fit a single notebook — e.g. multi-process multi-GPU FWI — see:
- Multi-GPU DDP (
fwi_marmousi_dist.py) — Torchtorchrundriver that scales one-shot-per-rank across multiple GPUs and syncs gradients withtorch.distributed.
Browse examples/
on GitHub for the full collection of runnable scripts.