But I would still be glad if someone with more PyTorch experience could give me feedback to my code. This is the first loss function that I wrote and I am not really sure if it is done 100% correctly.