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

Incorrect mask type in Seq2Seq encoder #68

Open
david-waterworth opened this issue Sep 9, 2021 · 0 comments
Open

Incorrect mask type in Seq2Seq encoder #68

david-waterworth opened this issue Sep 9, 2021 · 0 comments

Comments

@david-waterworth
Copy link

david-waterworth commented Sep 9, 2021

The seq2seq implementation of mean and max pooling crashes using allennlp 2.7 and pytorch 1,8

The issue is that both mean and max pooling mask the encoded output by converting the original mask from bool to float and multiplying. This masked tensor is then passed to masked_mean or masked_max along with the float mask, but masked_mean or masked_max require a bool mask, 'masked_max` fails on the first line

vector.masked_fill(~mask, min_value_of_dtype(vector.dtype))

It seems unnecessary in the first place to mask the embeddings since that's done in masked_mean or masked_max

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