-
Notifications
You must be signed in to change notification settings - Fork 790
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
dde.gradients support 3D outputs #1928
base: master
Are you sure you want to change the base?
Conversation
Update example of heat equation (lululxvi#706)
Add document for Lorenz inverse with exogenous input (lululxvi#709)
OperatorPredictor supports backends tensorflow.compat.v1, tensorflow,…
… method of Lr decay in Pytorch
update to latest version
You need to test all backends. |
The only case where the output is 3D is shown to be supported only by tensorflow v2 and pytorch https://github.com/lululxvi/deepxde/blob/master/examples/operator/stokes_aligned_pideeponet.py |
Not necessary testing PI-DeepONet. You can manually construct a function, and jus test if dde.gradients works correctly. |
I have tested pytorch, tf v2, paddle, jax. I don't have access to the environment for tf v1 |
@@ -21,11 +21,11 @@ def __call__(self, i=None, j=None): | |||
# Compute J[i, :] | |||
if i not in self.J: | |||
if backend_name in ["tensorflow.compat.v1", "tensorflow"]: | |||
y = self.ys[:, i : i + 1] if self.dim_y > 1 else self.ys | |||
y = self.ys[..., i : i + 1] if self.dim_y > 1 else self.ys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since reverse mode doesn't support 3D anyway, we don't need to modify this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
deepxde/gradients/gradients.py
Outdated
""" | ||
if config.autodiff == "reverse": | ||
if bkd.ndim(ys) == 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raise this error in gradients_reverse.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
No description provided.