Skip to content

Examples

All examples on GitHubexamples/ (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

    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.

    Open notebook

  • FWI Acoustic Marmousi

    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.

    Open notebook

  • FWI Elastic Marmousi

    FWI · Elastic · Marmousi


    Same skeleton, but the equation is Elastic and the model is the (vp, vs, rho) triplet. vs and rho are derived from vp with Poisson + Gardner relations so the example still runs with zero downloads.

    Open notebook

  • FWI multiscale

    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.

    Open notebook

  • DAS Zhao vs Mu

    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.

    Open notebook

  • Wavefield VTI

    Wavefield · VTI + shear suppression


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

    Open notebook

  • Wavefield Elastic

    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.

    Open notebook

  • Memory strategies

    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.

    Open notebook

  • RTM Acoustic Marmousi

    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.

    Open notebook

  • Solver hyperparameters

    Solver · hyperparameters


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

    Open notebook

  • Wavefield Elastic TTI

    Wavefield · Elastic TTI


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

    Open notebook

  • 3D Overthrust FWI

    FWI · 3-D · Overthrust


    Acoustic FWI on a 3-D Overthrust volume — Acoustic3D solver, boundary-saving for memory, depth/inline/crossline slices of the recovered vp cube vs ground truth.

    Open notebook

  • Multi-GPU DDP

    Multi-GPU · DDP vs 1 GPU


    torchrun --nproc_per_node=N driver that shards shots across GPUs and syncs gradients via torch.distributed. Hits 3.79× speedup on 4× V100 for Marmousi FWI compared to a single-GPU baseline.

    Open notebook

  • IFWI SIREN

    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.

    Open notebook

  • Custom gradients

    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.

    Open notebook

  • Wavefield Topography

    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.

    Open notebook

  • ADCIG

    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.

    Open notebook

  • Elastic vector reflectivity

    Elastic vector reflectivity


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

    Open notebook

  • FWI VRZ Marmousi

    FWI · VRZ · Marmousi


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

    Open notebook

  • Extending: add a new equation

    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 PropTorch like any built-in.

    Open notebook

  • FWI boundary compression

    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} × dtype matrix (compiled and eager) — identical convergence, plus a runtime GPU-memory breakdown.

    Open notebook

  • Acoustic radiation pattern

    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.

    Open notebook

  • Elastic radiation pattern

    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é.

    Open notebook

Scripts

For workflows that don't fit a single notebook — e.g. multi-process multi-GPU FWI — see:

Browse examples/ on GitHub for the full collection of runnable scripts.