Hi Yanhong!



 Yanhong_Zhao:

Do you know a quick way of calculating the mean and standard deviation of pixel value for the three respective channels of the training set?


If your training set is packaged as a giant tensor, train,  (of shape
(nSample, width, height, nChannel)), then you can use
torch.mean() and torch.std() with the dim argument:
torch.mean (train, dim = (0, 1, 2).  This will return a tensor
of shape (nChannel, ) containing the means for each of the channels.
Best.
K. Frank