-
Notifications
You must be signed in to change notification settings - Fork 616
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
FEA: add SimpleX in general model #1282
Conversation
super(SimpleX, self).__init__(config, dataset) | ||
|
||
# Get user transaction history | ||
self.history_item_id, _, self.history_item_len = dataset.history_item_matrix() |
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.
在gpu运行时会报错,需要在这里添加self.history_item_id = self.history_item_id.to(self.device)以及self.history_item_len=self.history_item_len.to(self.device)
pos_item = pos_item[0:user_number] | ||
# history_len | ||
history_len = self.history_item_len[user] | ||
history_len = torch.minimum(history_len, torch.zeros(1)+self.history_len) |
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.
history_len=torch.minimum(history_len, torch.zeros(1, device=self.device)+self.history_len)
item_seq = self.history_item_id[user] | ||
item_seq = item_seq[:, :self.history_len] | ||
item_seq_len = self.history_item_len[user] | ||
item_seq_len = torch.minimum(item_seq_len, torch.zeros(1)+self.history_len) |
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.
item_seq_len=torch.minimum(item_seq_len, torch.zeros(1, device=self.device)+self.history_len)
item_seq = self.history_item_id[user] | ||
item_seq = item_seq[:, :self.history_len] | ||
item_seq_len = self.history_item_len[user] | ||
item_seq_len = torch.minimum(item_seq_len, torch.zeros(1)+self.history_len) |
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.
item_seq_len=torch.minimum(item_seq_len, torch.zeros(1, device=self.device)+self.history_len)
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.
ok,已进行修改并已提交。除此之外还修改了predict方法与full_sort_predict方法的部分变量名称让变量更通俗易懂
add SimpleX in general model