I think so, how does it work exactly? I just read about it.
Since I have five classes and I want to prioritize class 3 would it be something like:
num_sample = 5
weight = [0.5, 0.5, 0.5, 0.9, 0.5]
sampler = torch.utils.data.sampler.WeightedRandomSampler(weight, batch_size)
trainLoader = torch.utils.data.DataLoader(trainData, num_sample , shuffle=False, sampler=sampler)

Also found this comment “It looks like weights is a list of weights per data point in the data set we are drawing from, NOT a weight per class”