# Passing the weights to CrossEntropyLoss correctly

**URL:** <https://discuss.pytorch.org/t/passing-the-weights-to-crossentropyloss-correctly/14731>\
**Category:** Uncategorized\
**Created:** [March 10, 2018, 10:05pm UTC](https://discuss.pytorch.org/t/passing-the-weights-to-crossentropyloss-correctly/14731 "2018-03-10T22:05:18Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![MariosOreo](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mariosoreo/32/18330_2.png) [@MariosOreo](https://discuss.pytorch.org/u/MariosOreo)\
**Post date:** [May 7, 2019, 1:26am UTC](https://discuss.pytorch.org/t/passing-the-weights-to-crossentropyloss-correctly/14731/9 "2019-05-07T01:26:49Z")

</div>

I think we don’t need to normalize the weights of classes, using invert class sampling count is okay.

---

_[View the full topic](https://discuss.pytorch.org/t/passing-the-weights-to-crossentropyloss-correctly/14731)._
