google-research / augmix

AugMix: A Simple Data Processing Method to Improve Robustness and Uncertainty
Apache License 2.0
979 stars 157 forks source link

mean and std for every channel is 0.5 instead of (0.5071, 0.4867. 0.4408) as mean  and (0.2657, 0.2565, 0.2761) as std #19

Closed shashankskagnihotri closed 3 years ago

shashankskagnihotri commented 3 years ago

Hi, For normalizing cifar100 dataset, you used (0.5, 0.,5 0.,5) for mean and std instead of (0.5071, 0.4867. 0.4408) as mean and (0.2657, 0.2565, 0.2761) as std which is more commonly used. Is this by design? and if so, could you please explain in brief, as to why?

hendrycks commented 3 years ago

This so that converting between [-1,1] (image for a neural network) and [0,1] (image for viewing) is easy. For problems such as adversarial examples, one often needs to convert back and forth frequently. It also does not make much of a difference to performance if one uses (0.5, 0.,5 0.,5) vs (0.5071, 0.4867. 0.4408).

shashankskagnihotri commented 3 years ago

Thanks. :)