This repository provides a class BalancedMixupGenerator inherited from MixupGenerator.
MixupGenerator implements the mixup algorithm [1] efficiently, but I need generator to be aware of class balance even in a single batch.
This implementation fullfills this requirement.
This class generates class balanced batches that are mixup applied.
- Batch size has to be greater than or equal to number of classes.
python setup.py install
[1] H. Zhang, M. Cisse, Y. N. Dauphin, and D. Lopez-Paz, "mixup: Beyond Empirical Risk Minimization," in arXiv:1710.09412, 2017.
[2] Z. Zhong, L. Zheng, G. Kang, S. Li, and Y. Yang, "Random Erasing Data Augmentation," in arXiv:1708.04896, 2017.