Machine Learning, Deep Learning, Artificial Intelligence, Mathematics, Physics.
create_graph=True)[0] u_x = torch.autograd.grad(u, x, create_graph=True)[0] u_xx = torch.autograd.grad(u_x, x, create_graph=True)[0] f = u_t + u * u_x - (0.01/torch.pi) * u_xx return f def compute_loss(t_u, x_u, u_true, t_f, x_f): loss = nn.MSELoss() u = u(t_u, x_u) t_f.requires_grad = True