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

About Observers in the paper #15

Open
shunyuzh opened this issue Aug 25, 2021 · 3 comments
Open

About Observers in the paper #15

shunyuzh opened this issue Aug 25, 2021 · 3 comments

Comments

@shunyuzh
Copy link

Hi Mehri,
Thanks for your awesome work 'Example-Driven Intent Prediction with Observers', and your open sourcing codebase.
How did you add observers to bert model in your codebase? I can't find what is related to [OBS]. Did you use the [PAD] as the [OBS]? And how did you make Observers the tokens that are not attended to?
Looking forward to your reply.

@shunyuzh
Copy link
Author

@mihail-amazon Hi, could you help?

@Shikib
Copy link

Shikib commented Jan 13, 2022

Apologies for the extremely late reply. I'm not an official collaborator on this repo, so I did not get a notification about your issue. To answer your question, yes [PAD] tokens were used as [OBS]. By default, [PAD] tokens attend to all other tokens however they are masked by all other tokens. This line in the code is responsible for averaging over the necessary number of observers:

pooled_output = hidden_states[:, -self.num_observers:].mean(dim=1)

@shunyuzh
Copy link
Author

Got it! I have also noticed it. 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

2 participants