Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PI-DeepONet example for 1D Poisson equation. #1311

Merged

Conversation

samuelburbulla
Copy link
Contributor

This PR proposes an example for training a physics-informed DeepONet with DeepXDE.
The example solves a simple one-dimensional Poisson equation where the source term is the input to the solution operator.

Related to #1308.

@samuelburbulla
Copy link
Contributor Author

I improved this PR a little more:

  • Incorporate some fixes for using PyTorch backend
  • Add auxiliary_variables in PyTorch.NN
  • Use L-BFGS for training the DeepONet

Here's a plot of the result:

pideeponet_poisson1d

@lululxvi
Copy link
Owner

I suggest splitting this PR into two separate PRs

  1. the demo example code;
  2. Pytorch backed code.

@samuelburbulla
Copy link
Contributor Author

Thanks, @lululxvi, for your review!

This PR is now split into:

I have found better solutions for the points mentioned, see comments above.

@sibyjackgrove
Copy link

@samuelburbulla Thanks for making this very useful example. @lululxvi would you be merging this soon?

@samuelburbulla samuelburbulla force-pushed the feature/example-pideeponet-poisson1d branch from be1a659 to 43d755c Compare June 12, 2023 13:07
@lululxvi
Copy link
Owner

Which backends does the new code support? The existing code supports tensorflow 1.x.

@samuelburbulla samuelburbulla force-pushed the feature/example-pideeponet-poisson1d branch from f4c31f3 to d6fc405 Compare June 22, 2023 13:48
@samuelburbulla
Copy link
Contributor Author

Which backends does the new code support? The existing code supports tensorflow 1.x.

This example is tested with tensorflow.compat.v1, tensorflow, and pytorch.

deepxde/model.py Outdated Show resolved Hide resolved
@lululxvi
Copy link
Owner

I have added a few PI-DeepONet examples, see https://deepxde.readthedocs.io/en/latest/demos/operator.html#pi-deeponet

Could you split this PR into two PRs:

  1. only modify the source code;
  2. add new example

@samuelburbulla
Copy link
Contributor Author

I have added a few PI-DeepONet examples

Nice!

Could you split this PR into two Pls

Done, see #1379.

@samuelburbulla
Copy link
Contributor Author

Rebased on master.

Together with #1403, this example works with all mentioned backends.

Is there anything else that needs to be done here?

@lululxvi
Copy link
Owner

lululxvi commented Aug 2, 2023

Reformat via black https://pypi.org/project/black/

@samuelburbulla samuelburbulla force-pushed the feature/example-pideeponet-poisson1d branch from ee4efe1 to c44269a Compare August 2, 2023 08:50
@lululxvi lululxvi merged commit 683682c into lululxvi:master Aug 23, 2023
10 checks passed
@samuelburbulla samuelburbulla deleted the feature/example-pideeponet-poisson1d branch August 23, 2023 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants