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:
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)