Hi Ali!
I don’t have an answer to your question, but I do have a question
for you, below.



 Ali_Mirzaeyan:

Hi,
imagine we have 10 classes and each class has 100 images and also the batch_size is 10. I want the dataloader, each time select one of the classes randomly and then select a batch from the images inside that particular class. Do I need to write some sampler (or used available ones) or I can handle this some  other way ?


I’m curious why you would want to do this.  Normally you shuffle
datasets and select random batches when you are training a
model, for example, when you are calculating the gradient
(averaged over the batch) to perform a gradient-descent step.
It would seemed to be counter-productive in such a situation to
have all of the samples in your batch be from the same class.
Not that it affects the answer to your question, but I am wondering
about the motivation and potential use case behind your question.
Thanks for any ideas or new tricks here.
K. Frank