# Question about data range when calculating loss function

**URL:** <https://discuss.pytorch.org/t/question-about-data-range-when-calculating-loss-function/74100>\
**Category:** Uncategorized\
**Created:** [March 23, 2020, 6:12am UTC](https://discuss.pytorch.org/t/question-about-data-range-when-calculating-loss-function/74100 "2020-03-23T06:12:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moravel](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@moravel](https://discuss.pytorch.org/u/moravel)\
**Post date:** [March 23, 2020, 6:12am UTC](https://discuss.pytorch.org/t/question-about-data-range-when-calculating-loss-function/74100/1 "2020-03-23T06:12:17Z")

</div>

Hi! My network use image data scaled from (0, 255) to (0, 1) as input and the output data is in (0, 1) too. `torch.optim.Adam` is used as optimizer and I calculate loss using output and ground truth in (0, 1).

Should I scale the data back to (0, 255) when calculating loss function? Is it useful in training process?
