Deepwave¶
Deepwave offers PyTorch-integrated wave propagators, enabling efficient forward modelling and backpropagation for gradient calculation in inversion and optimisation tasks. It currently supports 2D standard and Born modelling of the scalar wave equation, alongside propagation with the elastic wave equation, optimised for both CPUs and GPUs.
Installation¶
It is recommended to first install PyTorch by following the instructions on the PyTorch website. Once PyTorch is installed, Deepwave can be installed using pip:
pip install deepwave
This method should work for most users. However, if you have an unusual system configuration, you might need to build Deepwave from source. Instructions for building from source are provided below.
As Deepwave is built on PyTorch, a good understanding of PyTorch will significantly enhance your experience. The PyTorch website offers many helpful tutorials.
Building from source¶
Deepwave uses cibuildwheel and scikit-build-core for its build process. When you run pip install deepwave, pip will first attempt to download a precompiled wheel if one is available for your system. If a suitable precompiled wheel is not found, pip will automatically download the source distribution and attempt to compile it on your system. You will need to have a C compiler and CMake available, and a CUDA compiler if you wish to have CUDA support.
If you wish to force building from source rather than using a wheel (such as because your system does not have AVX2 support, which the wheels assume is available), you can use the following command:
pip install deepwave --no-binary deepwave
This command forces pip to download and compile the source distribution on your system, bypassing any precompiled wheels.
Support¶
If you encounter any issues (e.g., typos, broken links, unexpected behaviour, examples that don’t work), or have suggestions for improvement, please file an issue on GitHub or send me an email. Your feedback is highly appreciated.
Contents:
- PyTorch
- What Deepwave Calculates
- Examples
- Forward modelling with Marmousi velocity model
- Full-Waveform Inversion (FWI)
- Least-Squares Reverse-Time Migration (LSRTM)
- Reducing memory usage by accumulating gradients over batches
- Further reducing memory consumption with checkpointing
- Using Batched Models
- Visualising wavefields and gradients with callbacks
- Matching a target final wavefield
- Location interpolation and dipoles
- Frequency tapering and time padding
- Distributed (multi-GPU) execution
- Elastic propagation and FWI
- Generated model
- Large gradients at edges
- Graph Space Optimal Transport
- Joint Migration Inversion
- Hessian
- Custom imaging condition
- Usage