Last active
May 31, 2023 11:09
-
-
Save epistoteles/c35bd5154a036748651d8caca11a7efe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from torchvision.datasets import CIFAR10 | |
dataset = CIFAR10('.', train=True, download=True) | |
x = np.concatenate([np.asarray(dataset[i][0]) for i in range(len(dataset))]) | |
cifar10_mean = np.mean(x, axis=(0, 1)) | |
cifar10_std = np.std(x, axis=(0, 1)) | |
print(cifar10_mean) | |
print(cifar10_std) | |
# [125.30691805 122.95039414 113.86538318] | |
# [62.99321928 62.08870764 66.70489964] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment