Thanks for the code. Unfortunately I don’t understand it completely.

How are you changing the number of samples? Are you removing the files manually from certain folders?
How are find_classes and make_dataset used, as it seems you are using the torchvision.dataset.ImageFolder implementation? Also, what’s the reason to reimplement them?