-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renames mask to live_targets for cross_entropy_loss and binary_cross_entropy_loss. #329
Conversation
…_cross_entropy_loss`.
…_cross_entropy_loss`.
Need approval again. Thanks! |
predicted_labels = jnp.argmax(logits, axis=-1) | ||
accuracy = (jnp.equal(predicted_labels, target_labels) * mask).sum() / num_unmasked | ||
accuracy = (jnp.equal(predicted_labels, target_labels) * live_targets).sum() / denominator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ruoming, should we use this accuracy inside CrossEntropyLossMetrics::forward() instead of recalculating it in CrossEntropyLossMetrics::forward() ?
see: https://github.com/apple/axlearn/blob/main/axlearn/common/causal_lm.py#L108C1-L117C10
we can use loss_dict["accuracy"] instead of recalculating accuracy in causal_lm.py::CrossEntropyLossMetrics
@ruomingp @markblee
Motivation: mask is an ambiguous term and should be avoided. https://twitter.com/ericjang11/status/1739411438148739579