libffcv / ffcv

FFCV: Fast Forward Computer Vision (and other ML workloads!)
https://ffcv.io
Apache License 2.0
2.84k stars 178 forks source link

Correct CIFAR10_MEAN and CIFAR10_STD in train_cifar.py #322

Closed epistoteles closed 1 year ago

epistoteles commented 1 year ago

For some reason, the CIFAR10_STD used in the example differed significantly from the actual standard deviation of the CIFAR10 train dataset. I corrected both the MEAN and STD with 3 decimal places accuracy.

I calculated the values as seen here: https://gist.github.com/epistoteles/c35bd5154a036748651d8caca11a7efe

andrewilyas commented 1 year ago

Hi @epistoteles ! Thanks for this contribution. Just as a sanity check, can you make sure the CIFAR accuracy is still roughly the same as before using the default training script? I want to make sure the hyperparameters there aren't overfit to the wrong normalization.

wouterzwerink commented 1 year ago

Ran with old: test accuracy: 93.8% With new/correct mean and std: test accuracy: 94.0%

Varies a bit over runs of course, but seems fine @andrewilyas

andrewilyas commented 1 year ago

Thanks so much! Merging this now