Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 975
Süleyman Bilgin Avatar asked Oct 16 '22 17:10

Süleyman Bilgin


1 Answers

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.

like image 151
Kris Avatar answered Oct 30 '22 03:10

Kris