Writing a custom sampler as described e.g. here might also be a valid approach, as it would allow you to create the batch indices beforehand and thus make sure which class distribution is used.
Writing a custom sampler as described e.g. here might also be a valid approach, as it would allow you to create the batch indices beforehand and thus make sure which class distribution is used.