@@ -303,22 +303,21 @@ def num_flat_features(self, x):
303
303
# The values passed to the transform are the means (first tuple) and the
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
- # few lines of code:
307
- # ```
308
- # from torch.utils.data import ConcatDataset
309
- # transform = transforms.Compose([transforms.ToTensor()])
310
- # trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
306
+ # few lines of code::
307
+ #
308
+ # from torch.utils.data import ConcatDataset
309
+ # transform = transforms.Compose([transforms.ToTensor()])
310
+ # trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
311
311
# download=True, transform=transform)
312
312
#
313
- # # stack all train images together into a tensor of shape
314
- # # (50000, 3, 32, 32)
315
- # x = torch.stack([sample[0] for sample in ConcatDataset([trainset])])
313
+ # # stack all train images together into a tensor of shape
314
+ # # (50000, 3, 32, 32)
315
+ # x = torch.stack([sample[0] for sample in ConcatDataset([trainset])])
316
316
#
317
- # #get the mean of each channel
318
- # mean = torch.mean(x, dim=(0,2,3)) #tensor([0.4914, 0.4822, 0.4465])
319
- # std = torch.std(x, dim=(0,2,3)) #tensor([0.2470, 0.2435, 0.2616])
320
- #
321
- # ```
317
+ # # get the mean of each channel
318
+ # mean = torch.mean(x, dim=(0,2,3)) # tensor([0.4914, 0.4822, 0.4465])
319
+ # std = torch.std(x, dim=(0,2,3)) # tensor([0.2470, 0.2435, 0.2616])
320
+ #
322
321
#
323
322
# There are many more transforms available, including cropping, centering,
324
323
# rotation, and reflection.
0 commit comments