# Understanding ignore\_index and reduce\_labels

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funderstanding-ignore-index-and-reduce-labels%2F64587%3E%5C
**Category:** Beginners\
**Created:** [December 4, 2023, 10:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funderstanding-ignore-index-and-reduce-labels%2F64587 "2023-12-04T22:34:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![panigrah](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@panigrah](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpanigrah)%5C
**Post date:** [December 5, 2023, 2:57am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funderstanding-ignore-index-and-reduce-labels%2F64587%2F2 "2023-12-05T02:57:55Z")

</div>

Ignore\_index is the index that is ignored for loss calculations etc. set to 255 - as that’s used in standard loss functions I believe. Some models default to 255 and others don’t set it - not sure exactly why. This will take your background pixels and also unlabelled pixels and set them to the ignore\_index value

Reduce\_labels - set to True. reindexes the label values so that they start from 0 after the background is set to 255

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funderstanding-ignore-index-and-reduce-labels%2F64587)._
