Coder Social home page Coder Social logo

ucl-bug / helmnet Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 8.0 12.88 MB

Deep-learning iterative solver for the heterogeneous 2D Helmholtz equation

License: MIT License

Python 70.23% MATLAB 29.41% M 0.36%
acoustic convolutional-neural-networks deep-learning helmholtz pytorch simulator ultrasound

helmnet's People

Contributors

astanziola avatar btreeby avatar jchlebik avatar sio13 avatar sonypony avatar ykhas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

helmnet's Issues

About the hyperparameter "source_location".

When I want to change the location of the source, for example from (82,48) to (48,48), I just changed the parameters in base.json. Then I ran the evaluate.py. However, from the prediction results, I found that the location of the source did not change, still (82,48). I am wondering what else I need to do when I want to change the location of the source, besides changing the parameters in base.json, before I run evaluate.py? What should I do If I want to test the situation of two sources or more?

Thanks a lot for your suggestions.

Sigma not cast to GPU in `IterativeSolver.set_laplacian`

Currently, running inference fails when setting solver.to("cuda:0") because the sigma values in IterativeSolver.set_laplacian are not transferred to the GPU. The fix is to add .to(self.device) to sigmax and sigmay. The code is already there, but commented out from a previous PR.

Update residual calculation to account for absorption and heterogeneous density

The network was initially trained assuming constant density and no absorption. Initial tests show that the network may also generalise (even without re-training) to more general cases. This requires updating IterativeSolver.get_residual.

Absorption could possibly be implemented by adding an imaginary part to k_sq, while density gradients could be implemented using, e.g.,

rho_dx = self.Lap.dx(rho)

The additional parameters will need to be propagated through the code, e.g., by adding additional channels to the speed of sound input. This will need changing IterativeSolver.get_initials to only use the sound speed channel in the calculation of k_sq.

  k_sq, wavefield = self.get_initials(sos_maps)
  self.f.clear_states(wavefield)
  residual = self.get_residual(wavefield, k_sq)

To:

k_sq, wavefield, alpha, rho = self.get_initials(medium_maps)
self.f.clear_states(wavefield)
residual = self.get_residual(wavefield, k_sq, alpha, rho)

This will need to propagated in several places that call get_initials , get_residual, or use sos.

Add CI on the Readme example

  • I'm submitting a ...

    • bug report
    • feature request
    • other (e.g. discussion of ideas)
  • What is the current behavior?
    We don't have any test at all. At least having a test with CI that checks that the example in the README can be run would be great, since we are slowly changing this repo

  • What is the expected behavior?
    CI that tests at every merge on the main

Implement in 3D

A 3D version of the helmnet should be considered. This would require the following:

  • Extending the unet to 3D (Conv3D, MaxPool3D, etc)
  • Extend the training data to 3D
  • Add extra dimension (z) to all inputs, PML components etc
  • Extend operators (e.g., Spectral.LaplacianWithPML, etc)
  • Potentially reduce batch size for training
  • Check the replay buffer works with 3D data (or could potentially be replaced with binomial checkpointing as now being implemented in j-Wave)

Source location during evaluation

Feature request

  • What is the current behavior?
    Currently, there's no way to set the source location when running evaluate.py (see #9 ).

  • What is the expected behavior?
    To be able to set the source location while running the evaluation script

  • Other information
    The get_model method accepts source_location it as input. Adding the functionality should be as easy as adding a new argument to argparse and pass it to the __init__ method, down to get_model.

Refactor to use complex numbers

According to this repository for Fourier Neural Operators, they've made their code 30% faster by switching to native complex representation in PyTorch, which wasn't available when this work was published.

Is it worth refactoring the code to use complex multiplications? On one hand, it would be nice to have a faster codebase, on the other hand this repo makes sense for research but not really for production, so perhaps one doesn't really care about speed.

@sio13 @SonyPony Any suggestion? (Is it about time to just move everything to JAX? ๐Ÿ˜„ )

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.