-
Notifications
You must be signed in to change notification settings - Fork 617
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
Integrate softmax cpr to the latest RecBole version #1912
Conversation
|
||
all_memory_W = self.dropout(self.We(all_memory)) | ||
all_memory_W = all_memory_U.unsqueeze(1) | ||
all_memory_W = all_memory_U.expand(bsz, all_memory.size(1), seq_len, hsz) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all_memory_U
here should be replaced by all_memory_W
bsz, seq_len_2 = item_seq.size() | ||
logit_hidden_context = (projected_emb_arr[self.n_facet + self.n_facet_reranker*len(self.reranker_CAN_NUM) + i].unsqueeze(dim=2).expand(-1,-1,seq_len_2,-1) * test_item_emb[item_seq, :].unsqueeze(dim=1).expand(-1,seq_len_1,-1,-1) ).sum(dim=-1) | ||
if test_item_bias is not None: | ||
logit_hidden_reranker_topn += test_item_bias[item_seq].unsqueeze(dim=1).expand(-1,seq_len_1,-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logit_hidden_reranker_topn
here should be logit_hidden_context
@ken77921 Nice job! I've pointed out some minor mistakes in the code. Besides, you can add your personal information in the header of the model files. And it would be highly appreciated if you can complete the comments of the new parameters in the two yaml files so that the users can understand their meaning quickly. Last but not least, the test functions for these two models need to be added to the file |
@BishopLiu Thanks for the corrections. I am not very sure how to test |
@ken77921 Thank you for your great contribution! I'll merge it. |
Thank you for merging the pull request. I have a question. Will the descriptions of GRU4RecCPR and SASRecCPR be added to the documentation (https://recbole.io/docs/user_guide/model_intro.html)? |
Yes, we will add it during the next version update. |
The code is modified from https://github.com/iesl/softmax_CPR_recommend