Certainly there are advantages in random sampling; however, there are circumstances where the numbers of samples must be the same or pre-determined. So, I wonder how to implement this in pytorch? Should I rewrite every datasets or this can be achieved by a customized sampler used in dataloader? Thanks!\
To make myself clear:
what i need now is, for example, a batch of 10 samples from class A, 10 from class B, 10 from class C, ETC…