Physics Informed Learning, Neural Networks, Machine Learning, Differential Equations, Math.
create_graph=True)[0] # Define the differential equation and calculate the loss loss_DE = criterion(dy_dt + k*y_pred, torch.zeros_like(dy_dt)) # Define the initial condition loss loss_IC = initial_condition_loss(model(torch.tensor([[0.0]])), torch.tensor([[1.0]])) loss = loss_DE + loss_IC #