Class weights for CrossEntropyLoss

You would increase the weight for the minority class for add a penalty to the training for a wrong classification of it.
This post explains it with an example.