You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to solve time-independent 2D heat conduction with no source i.e. the Laplace equation using baseline PINN (the original one from Raissi). I set 4 different Dirichlet BCs (temperature) on a rectangular domain. Unfortunately, the loss won't converge because of the conflicting BCs at the corners making the solution discontinuous.
But on DeepXDE using dde.nn.pytorch.FNN() the loss converges like magic and results are amazingly close to FEM. I just wanted to know why it works? Is dde.nn.pytorch.FNN implementing something else? Also, I am using Pytorch as the backend so many PINNs are not available to use.
So, when we use dde.model.compile() the loss_weights=None unless I pass some values manually. In my case, I didn't pass loss_weights, meaning the loss function is the same as the baseline PINN.
I can see from this example that residual-based adaptive refinement (RAR) is implemented using add_anchors method manually which I didn't use.
What is it making the difference in the solution? Does dde.nn.pytorch.FNN() uses baseline PINN or gPINN?
I found another thing in the paper: choosing the network with the smallest training loss as the final solution from multiple random weght initialisations. But I didn't find the implementation of this part in the source code.
Here are my results:
This is the FEM solution using quadratic triangles.
You can clearly see the discontinuity at the corners.
This is from the baseline PINN: (20k epochs adam)
The black points denote prediction resulting in out-of-bounds from the common colormap.
This one is predicted from DeepXDE: (15k epochs adam)
The out-of-bounds values were very close to the bounds actually and this can be happily accepted as the solution.
Yes, DeepXDE really works out of the box. I am looking at your earlier commits when DeepXDE was first released to do some comparison with baseline PINN. Thanks for this wonderful package.
I was trying to solve time-independent 2D heat conduction with no source i.e. the Laplace equation using baseline PINN (the original one from Raissi). I set 4 different Dirichlet BCs (temperature) on a rectangular domain. Unfortunately, the loss won't converge because of the conflicting BCs at the corners making the solution discontinuous.
But on DeepXDE using
dde.nn.pytorch.FNN()
the loss converges like magic and results are amazingly close to FEM. I just wanted to know why it works? Isdde.nn.pytorch.FNN
implementing something else? Also, I am using Pytorch as the backend so many PINNs are not available to use.I went through the paper and the source code.
So, when we use
dde.model.compile()
theloss_weights=None
unless I pass some values manually. In my case, I didn't passloss_weights
, meaning the loss function is the same as the baseline PINN.I can see from this example that residual-based adaptive refinement (RAR) is implemented using
add_anchors
method manually which I didn't use.What is it making the difference in the solution? Does
dde.nn.pytorch.FNN()
uses baseline PINN or gPINN?I found another thing in the paper: choosing the network with the smallest training loss as the final solution from multiple random weght initialisations. But I didn't find the implementation of this part in the source code.
Here are my results:
This is the FEM solution using quadratic triangles.
You can clearly see the discontinuity at the corners.
This is from the baseline PINN: (20k epochs adam)
The black points denote prediction resulting in out-of-bounds from the common colormap.
This one is predicted from DeepXDE: (15k epochs adam)
The out-of-bounds values were very close to the bounds actually and this can be happily accepted as the solution.
The loss curve hardly has any oscillation in DeepXDE.
Here is my code for DeepXDE:
https://github.com/praksharma/temp/blob/15bd84bf6cb60051c42c30cd7114f6639d01c250/2D%20heat%20conduction.ipynb
Here is my baseline PINN code just in case someone is interested:
https://github.com/praksharma/temp/blob/main/Improved_structure.ipynb
The text was updated successfully, but these errors were encountered: