I am basically working on a model that changes the binary classification task every batch during training. So I want to balance the samples for that particular task every forward pass. I have collected the weights over the whole dataset for each task and stored them in a (10,2) array (10 tasks). For example [[1  2.43] [1  3.5]…]]. Could you tell me about a way to go about this?
About the data:
I get a sample of dimensions (64,3,224,224) where 64 is the batch size, and the labels array of size (64,10) from the dataloader. I extract columns accordingly to get the labels for a particular task.