I am trying to develop a model with a custom loss function which involves using of two different data sets simultaneously …
But I am getting many errors…Also, i am getting many NaNs, for following code…
def my_loss(dX, target1, x2, target2):
  target1=torch.tensor(target1, dtype=torch.double)
  target2=torch.tensor(target2, dtype=torch.double)

  out1=model(dX)
  out2=model(x2)


  l1= ((target1-out1)**2).mean()

  l2= ((target2-out2)**2).mean()

  return torch.mean(l1+l2)