-
Kindly ask for help me resolve the following error. Here's an example adapted from the official example about the inverse modeling of the reaction-diffusion system:
I ran this example on a Ubuntu 22.04 computer with
Specifically, the error occurs at Some detailed explanation on the codes:
to
which basically assumes that the initial distribution is centered at an unknown |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have finally solved this issue. The problem stems from a decorator To implement a PINN with initial values depending on trainable parameters, one needs to modify the source code. For me, I add a
and a
Similar modifications can be done to boundary conditions. |
Beta Was this translation helpful? Give feedback.
I have finally solved this issue.
The problem stems from a decorator
npfunc_range_autocache
wrapped on thefunc
evaluating the initial/boundary values. Under the PyTorch/Paddle backend, this decorator intends to store the initial/boundary values in the cache after its first calculation. In the rest of the process, the same values are just retrieved from the cache if requested. Therefore, starting from the 2nd iteration, the gradient of the initial/boundary values will be just old cached values, whose gradients have already been cleared. That's why I encountered the double backward error on the 2nd iteration.To implement a PINN with initial values depending on trainable parameters, one ne…