-
Notifications
You must be signed in to change notification settings - Fork 2
/
datasets.py
25 lines (16 loc) · 861 Bytes
/
datasets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from torchvision import datasets
class MNIST:
def __init__(self, root, transform):
self.num_channels = 1
self.train = datasets.MNIST(root, train=True, download=True, transform=transform)
self.test = datasets.MNIST(root, train=False, download=True, transform=transform)
class FashionMNIST:
def __init__(self, root, transform):
self.num_channels = 1
self.train = datasets.FashionMNIST(root, train=True, download=True, transform=transform)
self.test = datasets.FashionMNIST(root, train=False, download=True, transform=transform)
class CIFAR10:
def __init__(self, root, transform):
self.num_channels = 3
self.train = datasets.CIFAR10(root, train=True, download=True, transform=transform)
self.test = datasets.CIFAR10(root, train=False, download=True, transform=transform)