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

Question about the layer representation from the first token of the X #2

Open
KnightZhang625 opened this issue Oct 18, 2022 · 0 comments

Comments

@KnightZhang625
Copy link

Hello,

Thanks for the easy-read code. I have a question about the code, could you please help me?

In your paper, you said "we use the hidden state of the first token in text x" (between equations (6) and (7)). From my understanding, you are using the first token of the text x, which should be the [cls] token. However, in your code, representation, _ = pooling_layer(hidden_states) (line 730 in model.py). Looks like you are using the output from the layer attention network, which is in the size of [batch_size, seq_length, hidden_size], then put them into the pooling layer and get the layer representation in the size of [batch_size, hidden_size]. If so, could you please tell me why you choose this way, instead of the method in paper.

Please forgive me if I misunderstand this! And thanks for the great work!

Jiaxin

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