The problem continues here (posted by accident):
My loss function is a function of many variables including the derivatives (MSELoss is used inside the function):
loss = loss_function(u_0.double(), u_0_target, v_0.double(), v_0_target, u_lb, u_rb, v_lb, v_rb, u_x_lb, u_x_rb, v_x_lb, v_x_rb, f_u, f_v)
then the optimizing step:
optimizer.zero_grad()
loss.backward()
optimizer.step()
I found that the model is able to fit the loss w.r.t. the variables u and v, but fails when trying to fit f_u and f_v which is a function of first and second derivatives.
I hope someone can notice a mistake because I am running out of ideas.
Thanks!