skyunyoo:

In order to know the cause, I checked the train image with WRS applied in each batch, and confirmed that the duplicate of pos data was serious because it was extremely imbalanced.


Was the batch even imbalanced after using the WeightedRandomSampler or do I misunderstand the sentence?



 skyunyoo:

Because of this overfitting, I wonder if there is a smapler that undersampling neg data, leaving pos data intact.


Under- or oversampling can be done by changing the weights for each sample.
E.g. if you are using 1/class_count_X for classX, you would try to balance the batch.
However, you could of course scale these weights to force some undersampling (and reducing the num_samples argument).