Bayesian physics informed neural network: how to include the data and physics losses
If I execute the code, I got
‘RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn’ on the dy_dx = torch.autograd.grad(y_pred_physics, xCP, torch.ones_like(y_pred_physics), create_graph=True)[0]
line.