# Cross Entropy Weighted

**URL:** <https://discuss.huggingface.co/t/cross-entropy-weighted/3559>\
**Category:** Beginners\
**Created:** [February 9, 2021, 3:06pm UTC](https://discuss.huggingface.co/t/cross-entropy-weighted/3559 "2021-02-09T15:06:05Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![BramVanroy](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bramvanroy/32/47360_2.png) [@BramVanroy](https://discuss.huggingface.co/u/BramVanroy)\
**Post date:** [February 10, 2021, 2:24pm UTC](https://discuss.huggingface.co/t/cross-entropy-weighted/3559/10 "2021-02-10T14:24:26Z")

</div>

I was wrong in my earlier statements. I was not taking into account that this is about T5 which formulates every problem as a text-to-text problem where the output labels are indeed “text” as taken from the vocab.

I am not sure how you can use weighted cross entropy loss here because the labels are not necessarily just one token (which would be easy). I’ll let @valhalla take this one.

But please do not “topic hijack” other topics ([T5 user defined loss function - #14 by peggy](https://discuss.huggingface.co/t/t5-user-defined-loss-function/566/14)).

---

_[View the full topic](https://discuss.huggingface.co/t/cross-entropy-weighted/3559)._
