We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I computed the mean and standard deviation of cifar dataset (train). While the means match, the standard deviations do not:
mean = [0.4913996458053589, 0.48215845227241516, 0.44653093814849854] std = [0.2470322549343109, 0.24348513782024384, 0.26158788800239563]
Relevant line from main.py:
pytorch-cifar/main.py
Line 34 in 49b7aa9
I am wondering what is the cause of this discrepancy. Relevant code that I used to compute these stats:
datasets = [ torchvision.datasets.CIFAR10('./data', download=True, train=True, transform=torchvision.transforms.ToTensor()) ] channels = 3 total = torch.zeros(channels) total_sq = torch.zeros(channels) num = 0 for ds in datasets: dl = DataLoader(ds, batch_size=1000) for images, targets in dl: total += torch.sum(images, (0, 2, 3)) total_sq += torch.sum(images * images, (0, 2, 3)) num += images.shape[0] * images.shape[2] * images.shape[3] mean = total / num mean_sq = total_sq / num std = torch.sqrt(mean_sq - mean**2) print(f'mean = {mean.tolist()}, std = {std.tolist()}')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I computed the mean and standard deviation of cifar dataset (train). While the means match, the standard deviations do not:
Relevant line from main.py:
pytorch-cifar/main.py
Line 34 in 49b7aa9
I am wondering what is the cause of this discrepancy. Relevant code that I used to compute these stats:
The text was updated successfully, but these errors were encountered: