in this pytorch tutorial, there is transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
, what is the purpose of this?
(i removed it and the code still works)
Artificial Intelligence Stack Exchange is a question and answer site for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment. It only takes a minute to sign up.
Sign up to join this communityin this pytorch tutorial, there is transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
, what is the purpose of this?
(i removed it and the code still works)
Those are mean and standard deviation used to standardize each channel of the images from IMAGENET used to train the torchvision pretrained models.
Since the models were trained using this preprocessing step, it is useful to apply it also when using those models for transfer learning on new data.