As I understand it, data augmentation should only be used for the train set.
However, as I understand the code in c4 week 2, “Transfer learning with MobilenetV2 exercise” it implements data augmentation on both the train and validation set.
The data_augmenter() sequential model includes layers of RandomFlip and RandomRotation.
This data_augmenter model then becomes preprocessing layers prior to the frozen mobilenet model used for transfer learning. (see model summary picture)
When model.fit is called, aren’t both train_data and validation data are passed to it?
Doesn’t this mean that both train_data and validation_data are augmented?
Also, In the general case, now that Keras recommends using preprocessing layers instead of ImageDataGenerator(which can run independently on train and test data), doesn’t this mean that train and validation_data are always both augmented if you use the preprocessing layer design paradigm?
In the Tensorflow Developer courses, you see the expected design pattern. You use ImageDataGenerator to preprocess the train data with augmentation(rotation, flip etc) and validation differently with rescale only.
Am I missing something? do keras preprocessing layers somehow not function on the validation dataset?