Skip to content

Commit

Permalink
Merge pull request #2 from thinkall/master
Browse files Browse the repository at this point in the history
Fix dim err of candidate_news_vector in prediction
  • Loading branch information
yusanshi authored Oct 14, 2020
2 parents 53c81b5 + db41671 commit 4644403
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/model/DKN/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_prediction(self, candidate_news_vector, clicked_news_vector):
"""
# candidate_size, len(window_sizes) * num_filters
user_vector = self.attention(candidate_news_vector,
clicked_news_vector.unsqueeze(dim=0))
clicked_news_vector.expand(candidate_news_vector.size(0), -1, -1))
# candidate_size
click_probability = self.click_predictor(candidate_news_vector,
user_vector)
Expand Down

0 comments on commit 4644403

Please sign in to comment.