Created
August 19, 2018 03:05
-
-
Save omarsar/6593db592056152d6cdc262bb4ad1bea 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
import torchvision | |
import torchvision.transforms as transforms | |
BATCH_SIZE = 64 | |
# list all 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