Hello there.
First of all, im having a great time playing around with PyTorch - thanks for that 
Now to my question.
Im building a CNN for sequential data using CrossEntropyLoss. I have 3 classes as output of which two are of interest and the last is used if one of the two wasnt a fitt:


Class 0: no fitt

Class 1: interest 1

Class 2: interest 2

All three classes are exclusive and my labeld training data is highly unbalanced in this order of occurences:  Class 0 >> Class 1 > Class 2. To compensate for the occurences im computing weights for the weight setting of the CrossEntropyLoss  like this:
def weights(labels, classes):  # classes = 3
    hist = torch.histc(labels, classes)
    m = hist.min()
    w = torch.tensor([v if v == 0 else m / v for v in hist])
    return w

After reading the documentation of CrossEntropyLoss again i stumbled over the ignore_index parameter which i havent noticed before. So i was wondering if this would help me but im not quite sure how to use this parameter in conjunction with the weights or to use it at all.
Would it make sense to set the ignore_index parameter to my Class 0?
If this is the case do i have to adapt my weight computation to ignore Class 0?