deepwave

Wave propagation modules for PyTorch.

https://github.com/ar4/deepwave

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 12 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.2%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Wave propagation modules for PyTorch.

Basic Info
  • Host: GitHub
  • Owner: ar4
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 5.05 MB
Statistics
  • Stars: 280
  • Watchers: 10
  • Forks: 55
  • Open Issues: 16
  • Releases: 0
Created over 7 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

Deepwave

DOI

Deepwave provides wave propagation modules for PyTorch, for applications such as seismic imaging/inversion. You can use it to perform forward modelling and backpropagation, so it can simulate wave propagation to generate synthetic data, invert for the scattering potential (RTM/LSRTM), other model parameters (FWI), initial wavefields, or source wavelets. You can use it to integrate wave propagation into a larger chain of operations with end-to-end forward and backpropagation. Deepwave enables you to easily experiment with your own objective functions or functions that generate the inputs to the propagator, letting PyTorch's automatic differentiation do the hard work of calculating how to backpropagate through them.

To install it, I recommend first installing PyTorch using the instructions on the PyTorch website. Deepwave can then be installed using pip install deepwave

The documentation contains examples and instructions on how to install and use Deepwave. You might also like to watch a video summary of Deepwave.

Features

  • Supports the 2D constant density acoustic / scalar wave equation (regular and Born modelling) and 2D elastic wave equation (P-SV)
  • Runs on CPUs and appropriate GPUs
  • The gradient of all outputs (final wavefields and receiver data) can be calculated with respect to the model parameters (wavespeed, scattering potential, etc.), initial wavefields, and source amplitudes
  • Uses the Pasalic and McGarry PML for accurate absorbing boundaries in the scalar wave propagator
  • Uses C-PML with the W-AFDA free-surface method for the elastic wave propagator
  • The PML width for each edge can be set independently, allowing a free surface (no PML) on any side
  • Finite difference accuracy can be set by the user
  • A region of the model around the sources and receivers currently being propagated can be automatically extracted to avoid the unnecessary computation of propagation in distant parts of the model
  • Double backpropagation through the regular scalar propagator, including calculating the Hessian

Quick Example

In a few lines you can make a velocity model, propagate a wave from a source in the top left corner to a receiver in the top right, calculate an objective function, and backpropagate to obtain its gradient with respect to the velocity. ```python import torch import deepwave import matplotlib.pyplot as plt

v = 1500 * torch.ones(100, 100) v[50:] = 2000 v.requiresgrad()

out = deepwave.scalar( v, gridspacing=4, dt=0.004, sourceamplitudes=deepwave.wavelets.ricker(25, 200, 0.004, 0.06).reshape(1, 1, -1), sourcelocations=torch.tensor([[[0, 0]]]), receiverlocations=torch.tensor([[[0, 99]]]) )

(out[-1]**2).sum().backward()

, ax = plt.subplots(1, 3, figsize=(9, 3)) ax[0].imshow(v.detach()) ax[0].settitle("Velocity model") ax[1].plot(out[-1].detach().flatten()) ax[1].settitle("Receiver data") ax[2].imshow(v.grad.detach(), vmin=-1e-5, vmax=1e-5) ax[2].settitle("Gradient") ``` Output from quick example

There are more examples in the documentation.

Citing

If you would like to cite Deepwave, I suggest: bibtex @software{richardson_alan_2023, author = {Richardson, Alan}, title = {Deepwave}, month = sep, year = 2023, publisher = {Zenodo}, version = {v0.0.20}, doi = {10.5281/zenodo.8381177}, url = {https://doi.org/10.5281/zenodo.8381177} }

Owner

  • Name: Alan Richardson
  • Login: ar4
  • Kind: user
  • Company: Ausar Geophysical

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you wish to cite Deepwave, I suggest this reference."
authors:
- family-names: "Richardson"
  given-names: "Alan"
  affiliation: "Ausar Geophysical"
title: "Deepwave"
version: 0.0.20
doi: 10.5281/zenodo.8381177
date-released: 2023-09-26
url: "https://github.com/ar4/deepwave"

GitHub Events

Total
  • Issues event: 24
  • Watch event: 66
  • Delete event: 1
  • Issue comment event: 87
  • Push event: 34
  • Pull request event: 3
  • Fork event: 9
  • Create event: 2
Last Year
  • Issues event: 24
  • Watch event: 66
  • Delete event: 1
  • Issue comment event: 87
  • Push event: 34
  • Pull request event: 3
  • Fork event: 9
  • Create event: 2

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 96
  • Total Committers: 3
  • Avg Commits per committer: 32.0
  • Development Distribution Score (DDS): 0.042
Top Committers
Name Email Commits
Alan Richardson a****r@t****e 92
Vladimir Kazei v****i@g****m 3
Átila Saraiva a****a@g****m 1
Committer Domains (Top 20 + Academic)
tcd.ie: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 86
  • Total pull requests: 6
  • Average time to close issues: 11 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 43
  • Total pull request authors: 3
  • Average comments per issue: 5.28
  • Average comments per pull request: 2.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 16
  • Pull requests: 3
  • Average time to close issues: 4 days
  • Average time to close pull requests: 6 months
  • Issue authors: 12
  • Pull request authors: 2
  • Average comments per issue: 1.94
  • Average comments per pull request: 0.33
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • ar4 (17)
  • aaelmeli (5)
  • guoketing (5)
  • izzatum (4)
  • lnnnn123 (3)
  • bbsun (3)
  • ADharaUTEXAS123007 (3)
  • Lujiang-ECUST (3)
  • acse-wz19 (3)
  • kimkin19212 (2)
  • yulongovo (2)
  • Ge0sz (2)
  • naveenguptaiitr (2)
  • jayantb1019 (2)
  • Cliveljq (2)
Pull Request Authors
  • vkazei (4)
  • dependabot[bot] (2)
  • AtilaSaraiva (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 207 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 20
  • Total maintainers: 1
pypi.org: deepwave

Wave propagation modules for PyTorch

  • Versions: 20
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 207 Last month
Rankings
Dependent packages count: 4.7%
Stargazers count: 6.0%
Forks count: 6.4%
Average: 9.8%
Downloads: 10.0%
Dependent repos count: 21.7%
Maintainers (1)
ar4
Last synced: 6 months ago

Dependencies

.github/workflows/nixTest.yml actions
  • actions/checkout v3 composite
  • cachix/install-nix-action v17 composite
.github/workflows/test.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/build.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v3 composite
  • actions/upload-artifact v3 composite
  • ilammy/msvc-dev-cmd v1 composite
.github/workflows/windows.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • ilammy/msvc-dev-cmd v1 composite
pyproject.toml pypi