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

Attention Weight Bug in Embedding #2

Closed
kandorm opened this issue Apr 1, 2019 · 1 comment
Closed

Attention Weight Bug in Embedding #2

kandorm opened this issue Apr 1, 2019 · 1 comment

Comments

@kandorm
Copy link

kandorm commented Apr 1, 2019

https://github.com/xhuang31/KEQA_WSDM19/blob/f923a15cc732e8844c26e4c653c306c90e067734/embedding.py#L56

There is a bug in this line, because 'self.attn(torch.cat((x, outputs), 1)' generate a tensor which size is
(seq_len*batch_size, 1), which results in all softmax results to be 1.0.

@xhuang31
Copy link
Member

xhuang31 commented Apr 2, 2019

Yes. You are right. It should be

attn_weights = F.softmax(self.attn(torch.cat((x, outputs), 1)), dim=0).

Then we would need different hyperparameters. I will leave this issue open and fine tune the updated model when I get time.

Thanks for your comments.

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