PINNs
PINNs copied to clipboard
Coefficient (0.01 / math.pi) without parentheses
class Net:
...
def loss_func(self):
...
loss_pde = self.criterion(du_dt + u.squeeze() * du_dx, 0.01 / math.pi * du_dxx)
...
return loss
Here the code of loss_pde = self.criterion(du_dt + u.squeeze() * du_dx, 0.01 / math.pi * du_dxx)
of coefficient 0.01 / math.pi need to be (0.01 / math.pi) , and the code will be loss_pde = self.criterion(du_dt + u.squeeze() * du_dx, (0.01 / math.pi) * du_dxx)
.
Then the result will change. It's so amazing.
I am not aware of that the change of parentheses would result in a change in the result. Did you fix the random seed to test out whether it is due to randomness?
I think it doesn't matter with the random seed cause
- As the coefficients decrease, the values start to get out of fit.
- I run the code over 3 times in every coefficients change without set torch.manual.seed. As a result, it's related to coefficients.