Use Weighted Random Sampler for Imbalanced Class

The weights tensor should contain a weight for each sample, not the class weights.
Have a look at this post for an example.

2 Likes