May 10, 2021
How to deal with an imbalanced dataset using WeightedRandomSampler in PyTorch.
PragatiWe use something called samplers for OverSampling. Though we did not use samplers exclusively, PyTorch used it for us internally. When we say shuffle=False, PyTorch ended up using SequentialSampler it gives an index from zero to the length of the dataset. When shuffle=True it ends up using a RandomSampler.