Hello everyone,
In PyTorch does exist a function to balance a batch using only N classes? I really interested to balance each batch using only some classes in a cyclic way of course, for instance:
Batch 0 [5,5,5,0,0,0] (“5 instances of class 0,1,2, and 0 instances somewhere else”)
Batch 1 [0,0,0,5,5,5]
Epoch finished…
I would like to use this approach because a need to have many instances per class and in the sometime balanced. The reason which i would to have 0 instances in some classes is due to Cuda out of memory…
Can you help me please?