The weight
argument for nn.NLLLoss
has to be a tensor containing the class weights, not the sample weights, i.e. weight
should have the shape [number_of_classes]
.
Let’s continue the discussion about the WeightedRandomSampler
in this thread.