MCPcopy Index your code
hub / github.com/pytorch/tutorials / load_data

Function load_data

beginner_source/hyperparameter_tuning_tutorial.py:82–96  ·  view source on GitHub ↗
(data_dir="./data")

Source from the content-addressed store, hash-verified

80# downloading the data separately.
81
82def load_data(data_dir="./data"):
83 # Mean and standard deviation of the CIFAR10 training subset.
84 transform = transforms.Compose(
85 [transforms.ToTensor(), transforms.Normalize((0.4914, 0.48216, 0.44653), (0.2022, 0.19932, 0.20086))]
86 )
87
88 trainset = torchvision.datasets.CIFAR10(
89 root=data_dir, train=True, download=True, transform=transform
90 )
91
92 testset = torchvision.datasets.CIFAR10(
93 root=data_dir, train=False, download=True, transform=transform
94 )
95
96 return trainset, testset
97
98######################################################################
99# Model architecture

Callers 3

train_cifarFunction · 0.85
test_accuracyFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_accuracyFunction · 0.68