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

Tentative: multi-dimensional outputs for pytorch and paddle #1631

Closed
wants to merge 1 commit into from
Closed

Tentative: multi-dimensional outputs for pytorch and paddle #1631

wants to merge 1 commit into from

Conversation

kuangdai
Copy link
Contributor

How this was done

I made it in two steps:

  1. moving the strategy classes from tensorflow's deeponet.py to a separate file deeponet_strategy.py so that all backends can share it
  2. adding strategeis to pytorch and paddle following the same way (with few synatx adaptions)

Remaining Issue

I noted that in call(self, x_func, x_loc, training=False) of DeepONetStrategy, the argument training is completely unused. It is kept in this PR because I don't know if it serves some other purpose. I suggest removal of it.

Tests

A file test_strat.py (renamed to test_start.txt for uploading) is attached in this description. It tests all the model classes (DeepONet, DeepONetCartesianProd, PODDeepONet) and strategy settings (single, independent, split both, split branch, split trunk), making sure that the forward pass yields the correct output shape. To reproduce the tests, put this file under the top directory and run

DDE_BACKEND=tensorflow python test_strat.py 
DDE_BACKEND=pytorch python test_strat.py 
DDE_BACKEND=paddle python test_strat.py

And you should see no errors.

test_strat.txt

@kuangdai kuangdai marked this pull request as ready for review January 24, 2024 16:33
@lululxvi
Copy link
Owner

lululxvi commented Jan 29, 2024

Great.

Could you make paddle a separate PR? As I need someone else to check the paddle code. We can focus on the tf and pytorch code first.

@kuangdai kuangdai closed this Feb 3, 2024
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.

2 participants