@@ -304,20 +304,20 @@ def num_flat_features(self, x):
304
304
# standard deviations (second tuple) of the rgb values of the images in
305
305
# the dataset. You can calculate these values yourself by running these
306
306
# few lines of code:
307
- # ::
308
307
#
309
- # from torch.utils.data import ConcatDataset
310
- # transform = transforms.Compose([transforms.ToTensor()])
311
- # trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
308
+ # ::
309
+ # from torch.utils.data import ConcatDataset
310
+ # transform = transforms.Compose([transforms.ToTensor()])
311
+ # trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
312
312
# download=True, transform=transform)
313
313
#
314
- # # stack all train images together into a tensor of shape
315
- # # (50000, 3, 32, 32)
316
- # x = torch.stack([sample[0] for sample in ConcatDataset([trainset])])
314
+ # # stack all train images together into a tensor of shape
315
+ # # (50000, 3, 32, 32)
316
+ # x = torch.stack([sample[0] for sample in ConcatDataset([trainset])])
317
317
#
318
- # # get the mean of each channel
319
- # mean = torch.mean(x, dim=(0,2,3)) #tensor([0.4914, 0.4822, 0.4465])
320
- # std = torch.std(x, dim=(0,2,3)) #tensor([0.2470, 0.2435, 0.2616])
318
+ # # get the mean of each channel
319
+ # mean = torch.mean(x, dim=(0,2,3)) # tensor([0.4914, 0.4822, 0.4465])
320
+ # std = torch.std(x, dim=(0,2,3)) # tensor([0.2470, 0.2435, 0.2616])
321
321
#
322
322
#
323
323
# There are many more transforms available, including cropping, centering,
0 commit comments