ptrblck:

Alternatively, you could also use a class weight and pass it to your criterion, if it fits your use case.
E.g.  nn.CrossEntropyLoss  accepts a weight tensor, which assigns a specific weight to each class.


Thanks Patrick, what does the tensor consists of? 5 values between zero and one?