Hello!
I have a case for image to image translation, where I want to use two classes of images (landscapes and faces), but I want to randomize batches of images in a way that classes are not mixed.
For example, landscape images should be used 4 out of 5 times and faces only 1 out of 5.
I haven’t found much of references for a case like this, I read a comment about using ConcatDataset to combine the two classes in a single dataset and then use ConcatDataset.cumulative_sizes to get the boundaries.
I’m planning to use a custom sampler and randomly select the index range for either class, but is there any better way to do this? Or any recommendation or pointers?