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

关于BitGCF代码的疑问 #72

Open
bachml opened this issue Jul 30, 2024 · 0 comments
Open

关于BitGCF代码的疑问 #72

bachml opened this issue Jul 30, 2024 · 0 comments

Comments

@bachml
Copy link

bachml commented Jul 30, 2024

BiTGCF代码里有这么一句:

with torch.no_grad():
self.source_user_embedding.weight[self.overlapped_num_users: self.target_num_users].fill_(0)
self.source_item_embedding.weight[self.overlapped_num_items: self.target_num_items].fill_(0)
self.target_user_embedding.weight[self.target_num_users:].fill_(0)
self.target_item_embedding.weight[self.target_num_items:].fill_(0)

根据我的理解,这里代码的作用是把source_user_embedding中的target domain user embedding给mask掉,请问user_embedding中source user和target user的排列顺序是怎样的?

如果source_user_embedding的user是按照 [只出现在source domain user] [overlap user] [只出现在target domain user]这个顺序排列的,那么对应的在source_user_embedding里mask掉target domain user的index应该是
self.source_user_embedding.weight[self.source_num_users: ].fill_(0)

而在在target_user_embedding里mask掉source domain user的index应该是
self.target_user_embedding.weight[:self.source_num_users - self.overlapped_num_users].fill_(0)

我不是很清楚现在代码中的逻辑是对应怎么的user排列顺序。

另外我看几行代码对embedding fill(0)的维度似乎也不对?

根据这个issue,这几行似乎对后续训练不产生任何影响,但这几行代码的逻辑还是让我很好奇。
#64

也许是我理解错了,但希望作者能帮我解答我的疑惑。谢谢!

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

1 participant