Iam unable to understand the problem correctly, but I can suggest few directions.


Use Splitting with stratification for imbalanced problems.(scikit has a function). It creates the train/test split with equal ratios among classes. see this 10


In Dataloader, drops_last is also the parameter which you need to focus on because it drops the samples which doesnot fit in the batch size.


Thanks.