Can any one give a simple example code to show how to create a new criterion?
Are you sure you didn’t find what you wanted here? Coz I’m amazed at the loss functions covered by PyTorch.
If interested, do check out how they’ve coded the existing ones. It’s actually quite simple. You can check it out here