Hello, I hope you are having a great time. Could you please help me about the following problem?
Because the range of the target values is completely different and oscillates between 0 to 6000, the target should be normalized to train the model.
For example :
t_mean = torch.mean(target)
t_std = torch.std(target)
t_normal = (target - t_mean)/t_std

How can I denormalize theprediction if the loss function depends on the first and second derivatives of the output of the NN w.r.t the input:
def P_loss(x,y):
    first_derivative = torch.autograd.grad(y, x, 
                                     grad_outputs, create_graph=True, retain_graph=True)[0]
    
    second_derivative = torch.autograd.grad(first_derivative, x,
                                      grad_outputs, create_graph=True, retain_graph=True)[0]
   
    eq  = 4*first_derivative[:,1] - second_derivative[:,0]

    loss = torch.mean(eq**2)

    return loss

I think
pred = model(input) 
pred = pred * t_std  +  t_mean

does not work correctly.