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

Padding without masking #8

Open
rrsayao opened this issue Jul 5, 2018 · 1 comment
Open

Padding without masking #8

rrsayao opened this issue Jul 5, 2018 · 1 comment
Labels

Comments

@rrsayao
Copy link

rrsayao commented Jul 5, 2018

I noticed you're padding your sequences but you never use mask_zero=True in your embedding layer. Does this not cause your progress to be based on correctfully guessing where the paddings are?

If I'm correct you could be guessing the output to the sentence "[ 0, 0, 0, ..., "no"] as "[ 0, 0, 0, ..., "yes"] and still get to 99% accuracy.

@aneesh-joshi
Copy link
Owner

@cerulean331
Sorry for replying so late!

Unfortunately, yes. I wasn't aware of masking at the time of writing this.
I know about it now. When I get time, I will make the changes and test the difference.

The convention, at the time of writing, as per my understanding was, the model will learn that 0 means we don't care about it and it would act as a no-op

Feel free to set mask_value=0 # I believe that's the new parameter.
I can't imagine it having any side effects. If you're able to test it and show improvements, please make a PR. :)

Also, please look at the other branch in the repo. I've made some changes since.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants