How to modify my training data (augmentation) while the model is training?

Hi. I want to know if there is a way in which I can train a model in Pytorch, look at the metrics of the model in each image (since my dataset is small), and at a given specific epoch, modify my training data (augmenting the problematic cases specifically), and continue the training? I would really appreciate any kind of help or advice on how to achieve this.

Hi @stv,
To augment the dataset while training

  1. First technique torchvision.transforms like flipping, adding noise,…,etc.
  2. Second technique is Alubumentation. This is my favorite one.

Example Implementation: Getting Started with Albumentation: Deep Learning Image Augmentation Technique in PyTorch | by Kevin Bok | Towards Data Science
Thanks.

Thank you. However, in the example you indicate the augmentations are all done before training, so this does not answer to my question.