I’m not sure how the samples should be drawn to balance them. The WeightedRandomSampler uses a weight for each sample and applies it to draw the data. Would it be possible to provide a weight for each sample? If not, could you explain how each batch should be created?