Excellent resource - thank you! They do have batch generators for Keras and Tensorflow - not for Pytorch though.
Another nice practical example how to deal with class imbalance by Francois Chollet, the creator of Keras:
https://colab.research.google.com/drive/1xL2jSdY-MGlN60gGuSH_L30P7kxxwUfM
The most recent update of Fastai implements Oversampling to handle unbalanced classes as a Callback.
You can call it as follows:
from fastai.callbacks import *
cb = OverSamplingCallback(learn)
learn.fit_one_cycle(4,callbacks = cb)
( Make sure you have the most recent fastai version first)
3 Likes