Created
August 31, 2019 13:35
-
-
Save omarsar/f423c29df9724be40b8a801a61bffe9d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
## parameter denoting the batch size | |
BATCH_SIZE = 32 | |
## transformations | |
transform = transforms.Compose( | |
[transforms.ToTensor()]) | |
## download and load training dataset | |
trainset = torchvision.datasets.MNIST(root='./data', train=True, | |
download=True, transform=transform) | |
trainloader = torch.utils.data.DataLoader(trainset, batch_size=BATCH_SIZE, | |
shuffle=True, num_workers=2) | |
## download and load testing dataset | |
testset = torchvision.datasets.MNIST(root='./data', train=False, | |
download=True, transform=transform) | |
testloader = torch.utils.data.DataLoader(testset, batch_size=BATCH_SIZE, | |
shuffle=False, num_workers=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment