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

The question of computing the token prediction Acc. #11

Open
Xiyu-AI opened this issue Sep 25, 2023 · 0 comments
Open

The question of computing the token prediction Acc. #11

Xiyu-AI opened this issue Sep 25, 2023 · 0 comments

Comments

@Xiyu-AI
Copy link

Xiyu-AI commented Sep 25, 2023

train.py:

compute the token prediction Acc.

non_pad_mask = cap_labels[:, 1:].ne(Constants.PAD)
n_word = non_pad_mask.sum().item()
cms_non_pad_mask = cms_labels[:, 1:].ne(Constants.PAD)
cms_n_word = cms_non_pad_mask.sum().item()
cap_loss /= n_word
cms_loss /= n_word

I'm a bit curious about the calculations. When computing the cap_loss and cms_loss, why are they both divided by n_word? And, why isn't cms_loss divided by cms_n_word? I'd appreciate your clarification. Thank you!

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

No branches or pull requests

1 participant