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

Reason for using Mask? #34

Closed
rishavbb opened this issue Aug 11, 2019 · 2 comments
Closed

Reason for using Mask? #34

rishavbb opened this issue Aug 11, 2019 · 2 comments

Comments

@rishavbb
Copy link

Firstly, the code is well written.
I am new to this field. I know how the masked_fill() works.
However, I want to know the exact reason why masking of features is done here. From what I understood, wherever the absolute sum of features along the last dimension is 0, you are basically avoiding its consideration for computing the score (in MHAtt)
What is the exact reason of doing so and how is it beneficial?

Thanks in advance.

@MIL-VLG
Copy link
Collaborator

MIL-VLG commented Aug 12, 2019

I assume you mean the mask used in the MCAN model since the rest methods do not use this function.

The reason for using masks is that the question & visual features contain zero-padded features to make the input features of the same shape, and we do not want these features to be involved in model training.

For visual features, the number of extracted objects is dynamic within [10,100], and for question features, the number of words is also dynamic within [1,14]. A detailed description of the input features can be found in the paper in CVPR2019

@rishavbb
Copy link
Author

Yes, I have read your paper, but the zero-padded features were linked with the masking never popped into my mind. Thanks a ton for sharing this. :)
My doubt is cleared and I am closing the the issue.

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

2 participants