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

Method __init__

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

Source from the content-addressed store, hash-verified

56
57class MNISTDataset:
58 def __init__(self, root='./data', train=True, transform=None, download=True):
59 if transform is None:
60 transform = transforms.Compose([
61 transforms.ToTensor(),
62 transforms.Normalize((0.1307,), (0.3081,))
63 ])
64
65 self.dataset = datasets.MNIST(root=root, train=train, transform=transform, download=download)
66 self.classes = [str(i) for i in range(10)]
67
68 def __len__(self):
69 return len(self.dataset)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected