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

FEA: add SimpleX in general model #1282

Merged
merged 3 commits into from
Jun 9, 2022
Merged

Conversation

dreaming-qin
Copy link

add SimpleX in general model

@2017pxy 2017pxy self-requested a review May 5, 2022 12:34
@Sherry-XLL Sherry-XLL requested a review from Wicknight May 9, 2022 09:42
@Sherry-XLL Sherry-XLL removed the request for review from 2017pxy May 9, 2022 09:42
@Sherry-XLL Sherry-XLL requested a review from 2017pxy May 11, 2022 02:29
super(SimpleX, self).__init__(config, dataset)

# Get user transaction history
self.history_item_id, _, self.history_item_len = dataset.history_item_matrix()
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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)

Copy link
Author

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方法的部分变量名称让变量更通俗易懂

@2017pxy 2017pxy merged commit 823389e into RUCAIBox:1.0.x Jun 9, 2022
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

Successfully merging this pull request may close these issues.

3 participants