Skip to content

Fix masking in label smoothing - #1760

Open
tandede wants to merge 2 commits into
google-deepmind:mainfrom
tandede:fix/masked-label-smoothing
Open

Fix masking in label smoothing#1760
tandede wants to merge 2 commits into
google-deepmind:mainfrom
tandede:fix/masked-label-smoothing

Conversation

@tandede

@tandede tandede commented Aug 20, 2026

Copy link
Copy Markdown

Summary

  • distribute label-smoothing mass only across categories selected by where
  • keep fully masked groups finite by using a nonzero normalization denominator
  • add JIT regression coverage for partial and fully masked category sets

Test plan

  • pre-commit run --files optax/losses/_smoothing.py optax/losses/_smoothing_test.py
  • python -m flake8 on the changed files
  • python -m pylint on the changed files (10.00/10)
  • pytest -q optax/losses/_smoothing_test.py (3 passed)
  • pytest -q -n 4 optax (2617 passed, 78 skipped, 3382 subtests passed)

@tandede
tandede marked this pull request as ready for review August 20, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant