Code Monkey home page Code Monkey logo

devito-fwi's Introduction

๐Ÿšฆ ๐Ÿšฆ This library is under early development. Expect things to constantly change until version v1.0.0. ๐Ÿšฆ ๐Ÿšฆ

This library contains all the required building blocks to perform Full Waveform Inversion (FWI) with Devito (for modelling). Our vision is to provide an abstract template to perform FWI with all sort of pre- and post-processing hooks that users can develop and seamlessy include into a stable and robust FWI engine.

By doing so, we also aim integrate this library with PyLops and PyProximal to benefit from their modular handling of linear and proximal operators.

At its current stage of development, devito-fwi can be schematically represented as follows:

DevitoFWIschematic

Project structure

This repository is organized as follows:

  • ๐Ÿ“‚ devitofwi: python library containing routines to perform FWI with Devito modelling engines;
  • ๐Ÿ“‚ data: folder containing sample data to run notebooks;
  • ๐Ÿ“‚ notebooks: set of jupyter notebooks used to showcase different ways to run FWI with devitofwi;
  • ๐Ÿ“‚ scripts: set of scripts notebooks used to showcase different ways to run FWI with devitofwi in distributed mode;

Notebooks

The following notebooks are provided:

  • ๐Ÿ“™ acoustic/Modelling_filtering.ipynb: notebook comparing modelling with a filtered wavelet and filtering of original data computed with unfiltered wavelet;
  • ๐Ÿ“™ acoustic/Gradient_comparison.ipynb: notebook comparing gradients from different objective functions;
  • ๐Ÿ“™ acoustic/Gradient_decoupled.ipynb: notebook comparing gradient computations with mixed computational graphs including a Torch Module (useful to embed NNs in FWI);
  • ๐Ÿ“™ acoustic/AcousticVel_L2_1stage.ipynb: notebook performing acoustic FWI parametrized in velocity with entire data;
  • ๐Ÿ“™ acoustic/AcousticVel_L2_1stagewrapper.ipynb: notebook performing acoustic FWI parametrized in velocity with entire data using AcousticFWI wrapper;
  • ๐Ÿ“™ acoustic/AcousticVel_L2torch_1stage.ipynb: notebook performing acoustic FWI parametrized in velocity with entire data using Torch AD-based objective function;
  • ๐Ÿ“™ acoustic/AcousticVel_L2adam_1stage.ipynb: notebook performing acoustic FWI parametrized in velocity with entire data wrapping wave engine in a Torch AD-based graph and using Adam solver;
  • ๐Ÿ“™ acoustic/AcousticVel_L2refr_1stage.ipynb: notebook performing acoustic FWI parametrized in velocity with only refracted waves;
  • ๐Ÿ“™ acoustic/AcousticVel_XCorrrefr_1stagewrapper.ipynb: notebook performing acoustic FWI parametrized in velocity with only refracted waves using XCorr objective function and AcousticFWI wrapper;
  • ๐Ÿ“™ acoustic/AcousticVel_L2_Nstages.ipynb: notebook performing acoustic FWI parametrized in velocity with entire data in N frequency stages;
  • ๐Ÿ“™ acoustic/AcousticVel_L2_Nstageswrapper.ipynb: notebook performing acoustic FWI parametrized in velocity with entire data in N frequency stages using AcousticFWI wrapper;
  • ๐Ÿ“™ acoustic/AcousticVel_L2refr_Nstages.ipynb: notebook performing acoustic FWI parametrized in velocity with only refracted waves in N frequency stages.

Scripts

The following scripts are also provided:

  • ๐Ÿ“™ acoustic/Gradient_comparison_mpi.ipynb: notebook computing gradients distributed across sources;
  • ๐Ÿ“™ acoustic/AcousticVel_L2_1stage.ipynb: notebook performing acoustic FWI parametrized in velocity distributed across sources;

Getting started ๐Ÿ‘พ ๐Ÿค–

Serial version

To ensure reproducibility of the results, we suggest using the environment.yml file when creating an environment.

Simply run:

./install_env.sh

It will take some time, if at the end you see the word Done! on your terminal you are ready to go. After that you can simply install your package:

pip install .

or in developer mode:

pip install -e .

Remember to always activate the environment by typing:

conda activate devitofwi

MPI version

Follow the same procedure described above. However, run

./install_mpienv.sh

and remember to always activate the environment by typing:

conda activate devitofwi_mpi

To do list ๐Ÿ“

The following list is intended to define some of the improvements that should be implemented moving forward:

  • Optimize time step in N stages FWI to avoid using a too large time step when working at low-frequency (not chosen from the velocity model and frequency of the observed data but from that of each stage)
  • Create acousticfwi wrapper that can implement multi-stage acoustic FWI with time-space masking (and can specialize to any alternative case)
  • Improve handling of user-defined source wavelets
  • Create NonLinear operator template class to be used for both propagators and norms implementing basic operations such as sum, multiply, etc...
  • Switch velocity units to always be km/s to avoid continously rescaling them inside the FWI codes

devito-fwi's People

Contributors

mrava87 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.