Selective load of data in dataloader

Hi everyone,

let imagine we have 10 classes and each one has 1000 image in it. is it possible to ensure the dataloader work only on 20% of classes 5, 6, 7, 8, 9, and whole data in classes 0, 1, 2, 3, 4 at each training epoch. I tried to make a new folder named extra and put 20% of each of classes 5, 6, 7, 8, 9 in it and removing these classes. but is there any simpler way?

you can write a custom sampler to achieve the same. you can read about it in the documentation