CIFAR 10 mean and standard deviation per channel for inputs

Hello everyone,

I was wondering if someone could take the time to explain what Jeremy is doing here to find the mean and standard deviation I think its going right over my head.

If someone could show me the math to come to those numbers as a conclusion it would be much appreciated.

This thread might help you -

Hi, probably there are better ways, but what I often do is something like that: (Not tested, out of my head)

  1. create a ImageClassifierData object md with some stats
s = np.asarray( [md.trn_ds.get_x(ind) for ind in range(md.trn_ds.n)])
means = [s[..., channel].mean() for channel in [0, 1, 2]]
stds = [s[..., channel].std() for channel in [0, 1, 2]]

If running out of memory take random subset of indices.

1 Like