Hi @ptrblck, Thank you very much for your answer.
My concern is that as my total number of classes (~2000) is more than the batch size (~16) which is length of sampler, wouldn’t it happen that with ‘replacement=True’(over sampling) and iterating till the length of the dataset, there might be many classes whose instances didn’t actually come up in the whole epoch. I mean as length of sampler (batch size << number of classes) it might happen that only instances from 16 class come up while iterating for one epoch for every batch.
Also, overall for one epoch the instances from each category should be nearly balanced while iterating over till the length of loader.
Sorry for much confusion as my English is weak.
To give idea, about my dataset there are top 50 head classes whose instances are more than 1500 and tail 100 classes whose instances are less than 5.
Is there some way in which I could actually verify that instances from all classes came up in an balanced way(may not be exact) during training for every epoch while iterating for total steps = total instances / batch size