Last active
May 8, 2018 19:16
-
-
Save johnolafenwa/143621c1814db95dd1267617a667a0da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Define transformations for the training set, flip the images randomly, crop out and apply mean and std normalization | |
train_transformations = transforms.Compose([ | |
transforms.RandomHorizontalFlip(), | |
transforms.RandomCrop(32,padding=4), | |
transforms.ToTensor(), | |
transforms.Normalize((0.5,0.5,0.5), (0.5,0.5,0.5)) | |
]) | |
#Load the training set | |
train_set =CIFAR10(root="./data",train=True,transform=train_transformations,download=True) | |
#Create a loder for the training set | |
train_loader = DataLoader(train_set,batch_size=32,shuffle=True,num_workers=4) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment