Skip to content

Why is there no normal categorical cross-entropy loss? #4668

Answered by carlosgmartin
yasharhon asked this question in Q&A
Discussion options

You must be logged in to vote

Computing cross-entropy directly from logits rather than probabilities avoids some redundant computation and/or improves numerical accuracy.

PyTorch takes a similar approach (see CrossEntropyLoss and NLLLoss), so this isn't unique to optax or flax.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yasharhon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants