bomri / code-for-posts

code scripts for blog posts I published
13 stars 5 forks source link

can this code be used to handle multi label imbalanced problem? #2

Open xyus opened 4 years ago

bomri commented 4 years ago

Hey @xyus, This code is an example to handle imbalanced datasets at the loader level. As is it doesn't support multi-label imbalanced datasets, but what is the actual problem you are trying to solve? For instance, you can use loss weights and multiply each class loss as described in https://discuss.pytorch.org/t/multi-label-multi-class-class-imbalance/37573/9. Or, taking into account all labels probabilities when calculating the weights per sample for the loader.