Mini-batch trimming python implementation (see my ASPAI 2021 paper "Some like it tough: Improving model generalization via progressively increasing the training difficulty", arxiv preprint at https://arxiv.org/abs/2110.13058).
The module in 'mnist_model.py' is a SimpleDensenet Model for MNIST classification. It is a pytorch lightning module, so you must have pytorch lightning installed.