I need to split the CIFAR10 dataset into training and validation set. The problem is that I wish to apply augmentations to training data. These are applied while loading the data. But if I split the data into validation set it also contains the augmentations which I obviously don’t want
train_transform = transforms.Compose([transforms.RandomRotation(10), 
                                       transforms.RandomHorizontalFlip(),
                                       transforms.ToTensor(),
                                       transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])

train_data = datasets.CIFAR10('data', train=True, download=True, transform=train_transform)

# Generate validation set - https://stackoverflow.com/a/51768651
train_size = int(len(train_data) * 0.8) # 80% training data
valid_size = len(train_data) - train_size # 20% validation data
train_data, valid_data = random_split(train_data, [train_size, valid_size])

This snippet above applies augmentations to validation data (since it is just a part of the originally loaded data). Can I split the data before applying transforms?