Error Retrieval calculation error & Fix some detailed problems - #11
Open
ztxtech wants to merge 2 commits into
Open
Error Retrieval calculation error & Fix some detailed problems#11ztxtech wants to merge 2 commits into
Error Retrieval calculation error & Fix some detailed problems#11ztxtech wants to merge 2 commits into
Conversation
…ng CUDA as the device.
|
Thanks for the contribution! Before we can merge this, we need @ztxtech to sign the Salesforce Inc. Contributor License Agreement. |
Author
|
There is a calculation error here. The Attention value should be weighted and memorized instead of the corresponding index. Original code at ...
v, idx = torch.topk(att, 2)
ww = torch.index_select(self.W, 1, idx)
idx = idx.unsqueeze(1).float()
old_w = ww @ idx
...Corrected code ...
v, idx = torch.topk(att, 2)
ww = torch.index_select(self.W, 1, idx)
old_w = ww @ v.clone().detach().unsqueeze(1).float()
... |
Error Retrieval calculation error & Fix some detailed problems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Change outdated methods and fix some modules that default to specifying CUDA as the device.