# Understanding transform.Normalize( )

**URL:** <https://discuss.pytorch.org/t/understanding-transform-normalize/21730>\
**Category:** vision\
**Created:** [July 25, 2018, 11:09pm UTC](https://discuss.pytorch.org/t/understanding-transform-normalize/21730 "2018-07-25T23:09:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![InnovArul](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/innovarul/32/5282_2.png) [@InnovArul](https://discuss.pytorch.org/u/InnovArul)\
**Post date:** [July 25, 2018, 11:39pm UTC](https://discuss.pytorch.org/t/understanding-transform-normalize/21730/2 "2018-07-25T23:39:01Z")

</div>

Normalize does the following for each channel:

`image = (image - mean) / std`

The parameters `mean, std` are passed as 0.5, 0.5 in your case. This will normalize the image in the range [-1,1]. For example, the minimum value 0 will be converted to `(0-0.5)/0.5=-1`, the maximum value of 1 will be converted to `(1-0.5)/0.5=1.`

if you would like to get your image back in [0,1] range, you could use,

`image = ((image * std) + mean)`

About whether it helps CNN to learn better, I’m not sure. But majority of the papers I read employ some normalization schema. What you are following is one of them.

Hope it helps.

---

_[View the full topic](https://discuss.pytorch.org/t/understanding-transform-normalize/21730)._
