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

MASS-supNMT: Args say word_mask_keep_rand but code is word_mask_rand_keep #139

Open
JasonVann opened this issue Apr 30, 2020 · 0 comments
Open

Comments

@JasonVann
Copy link

Hi there, I think I found a typo or I'm confused. In MASS-supNMT, xmasked_seq2seq.py, word_mask_keep_rand defaults to '0.1, 0.1, 0.8'.

Then this mask_keep_rand is passed to args as "pred_probs" on line 119 , which is then passed to MaskedLanguagePairDataset

In masked_language_pair_dataset.py, in random_word(), the way pred_probs is [used] is here

cands = [self.vocab.mask_index, np.random.randint(self.vocab.nspecial, len(self.vocab)), w]
prob = torch.multinomial(self.pred_probs, 1, replacement=True)

From the code we see that pred_probs is acutally used as mask, random, keep, not word_mask_keep_rand. This implies the default args 0.1, 0.1, 0.8 is not mask 0.1, keep 0.1, rand 0.8, but actually mask 0.1, rand 0.1, keep 0.8, quite different from what the variable name says

In short, word_mask_keep_rand should have been named as word_mask_rand_keep.

@JasonVann JasonVann changed the title MASS-supNMT: Args says word_mask_keep_rand but code is word_mask_rand_keep MASS-supNMT: Args say word_mask_keep_rand but code is word_mask_rand_keep Apr 30, 2020
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