Süleyman Bilgin
Süleyman Bilgin

Reputation: 172

CIFAR-10 Meaningless Normalization Values

I tried to build a neural network for a CIFAR-10 database. I used Pytorch Framework.

I have a question about of data loading step.

transform_train = T.Compose([
    T.RandomCrop(32, padding=4),
    T.RandomHorizontalFlip(),
    T.ToTensor(),
    T.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
])

trainset = tv.datasets.CIFAR10(root=root, train=True, download=True, transform=transform_train)

This is a normal step for data loading step. While loading data, I am normalizing values. At the beginning of the my project I found below row.

T.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))

After I searched better transform values, I found this values.

T.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010))

I did not find an explanation why these values were used. Do you have a description of these values?

Upvotes: 5

Views: 11946

Answers (1)

Kris
Kris

Reputation: 528

I think you can have a look here:

The first three values are the means over each channel, while the second triple are the standard deviations.

Upvotes: 3

Related Questions