Skip to content

Commit

Permalink
more memory efficient CSLS
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Lample committed Jun 28, 2018
1 parent 1cd1f7b commit 03af0ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/evaluation/word_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def get_word_translation_accuracy(lang1, word2id1, emb1, lang2, word2id2, emb2,
query = emb1[dico[:, 0]]
scores = query.mm(emb2.transpose(0, 1))
scores.mul_(2)
scores.sub_(average_dist1[dico[:, 0]][:, None] + average_dist2[None, :])
scores.sub_(average_dist1[dico[:, 0]][:, None])
scores.sub_(average_dist2[None, :])

else:
raise Exception('Unknown method: "%s"' % method)
Expand Down

0 comments on commit 03af0ae

Please sign in to comment.