Skip to content
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

Merged
merged 7 commits into from
Feb 18, 2024

Conversation

ruomingp
Copy link
Contributor

Motivation: mask is an ambiguous term and should be avoided. https://twitter.com/ericjang11/status/1739411438148739579

@ruomingp ruomingp marked this pull request as ready for review February 18, 2024 02:28
@ruomingp ruomingp requested a review from markblee February 18, 2024 02:28
@ruomingp ruomingp enabled auto-merge February 18, 2024 02:30
@ruomingp
Copy link
Contributor Author

Need approval again. Thanks!

@ruomingp ruomingp added this pull request to the merge queue Feb 18, 2024
Merged via the queue into apple:main with commit 2fa2ca0 Feb 18, 2024
3 checks passed
@ruomingp ruomingp deleted the rpang_mask branch February 18, 2024 18:20
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
Copy link
Contributor

@apivovarov apivovarov Feb 10, 2025

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

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.

3 participants