Skip to content

A ready-to-use & class-based-module for directly implementation of class balanced loss in pytorch

License

Notifications You must be signed in to change notification settings

EMUNES/pytorch-made-class-balanced-loss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

pytorch-made-class-balanced-loss

A ready-to-use & class-based-module for direct implementation of class balanced loss in pytorch

一个现成的,基于pytorch nn.Module类的class balanced loss实现

Thanks to the great work of vandit15 in class-balanced-loss-pytorch. See more detailed info about class balanced loss in his git.

Also all credits to original authors and researchers working on the paper about class balanced loss. Check in the .py file to see their paper.

reason for this repo

Class Balanced Loss worked pretty well for many class imbalanced datasets, especially when samples in the dataset are limited (below 10000). If the dataset is rather small, Class Balanced Loss can move focus to the small class in a very astonishing way (In one case the f1_score jumps from 0.0 to 0.3).

So I modified the codes from the original author and add some features for real-time usuage when building models using pytorch. Those codes help me through most situations. Hope this will help you too.

About

A ready-to-use & class-based-module for directly implementation of class balanced loss in pytorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages