PyTorch計算dataset的mean和std

mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]
這篇討論串的留言提到
Just note that you need to use your own mean and std if your dataset is not similar to ImageNet. In the 3-channel case you have mentioned, you are using mean and std from ImageNet which works for most of the datasets that are similar but if you are using datasets such as medical image processing, then you need to obtain proper mean and std regarding your own dataset.
如果我們自己的資料集與ImageNet差異很大,或許就可以考慮針對自己的Dataset來計算mean和std,作為normalize的參數。
(a)ImageNet的mean和std
(b)自己資料集中的mean和std

--

--

--

Machine Learning | Deep Learning | https://linktr.ee/yanwei

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Yanwei Liu

Yanwei Liu

Machine Learning | Deep Learning | https://linktr.ee/yanwei

More from Medium

Data Labeling: How AI Can Streamline Your Data Labelling?

All About Pooling Layers for Convolutional Neural Networks (CNN)

Brain Tumor Segmentation using Deep Learning models

Creating Semantic Segmentation Labels for Training Data.