MCPcopy Create free account
hub / github.com/geekcomputers/Python / __init__

Method __init__

ML/src/python/neuralforge/data/datasets.py:93–109  ·  view source on GitHub ↗
(self, root='./data', split='train', transform=None, download=True)

Source from the content-addressed store, hash-verified

91
92class STL10Dataset:
93 def __init__(self, root='./data', split='train', transform=None, download=True):
94 if transform is None:
95 if split == 'train':
96 transform = transforms.Compose([
97 transforms.RandomCrop(96, padding=12),
98 transforms.RandomHorizontalFlip(),
99 transforms.ToTensor(),
100 transforms.Normalize((0.4467, 0.4398, 0.4066), (0.2603, 0.2566, 0.2713))
101 ])
102 else:
103 transform = transforms.Compose([
104 transforms.ToTensor(),
105 transforms.Normalize((0.4467, 0.4398, 0.4066), (0.2603, 0.2566, 0.2713))
106 ])
107
108 self.dataset = datasets.STL10(root=root, split=split, transform=transform, download=download)
109 self.classes = ['airplane', 'bird', 'car', 'cat', 'deer', 'dog', 'horse', 'monkey', 'ship', 'truck']
110
111 def __len__(self):
112 return len(self.dataset)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected