Using the Dataset Class for an "On-the-Fly augmentation"

My question is the use of transforms in the Dataset class. How will one be able to do the ‘on-the fly’ data augmentation with the class. I learnt to do that, you have to define a different transforms for the validation and train datasets

You only have to augment the training set. The purpose is to give you a larger dataset for training.

You don’t necessarily need to augment the validation and test sets.

1 Like

I have not gotten to this assignment yet (PyTorch C2M2), but there were worked examples of how to do dataset augmentation in C1 M4 in both the code examples and the assignment there. You can go back and have a look at how they did it. They implement the transformations including the selected data augmentations and then those are used when loading the dataset. As Tom says, they structure it such that the additional transforms are only done for the training dataset.