You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, you described that you set the scores of training items to negative infinity for top-k prediction.
However, dataloader.general_dataloader.FullSortEvalDatalLoader.collate_fn returns None as history unless is_sequential is true.
Therefore trainer.Trainer._full_sort_batch_eval can not use history_index to mask scores into -infinity.
Would you please clarify how masking works?
def collate_fn(self, index):
index = np.array(index)
if not self.is_sequential:
user_df = self.user_df[index]
uid_list = list(user_df[self.uid_field])
history_item = self.uid2history_item[uid_list]
positive_item = self.uid2positive_item[uid_list]
history_u = torch.cat(
[
torch.full_like(hist_iid, i)
for i, hist_iid in enumerate(history_item)
]
)
history_i = torch.cat(list(history_item))
positive_u = torch.cat(
[torch.full_like(pos_iid, i) for i, pos_iid in enumerate(positive_item)]
)
positive_i = torch.cat(list(positive_item))
return user_df, (history_u, history_i), positive_u, positive_i
else:
interaction = self._dataset[index]
transformed_interaction = self.transform(self._dataset, interaction)
inter_num = len(transformed_interaction)
positive_u = torch.arange(inter_num)
positive_i = transformed_interaction[self.iid_field]
return transformed_interaction, None, positive_u, positive_i
chanwoo0806
changed the title
[馃悰BUG] Handling scores on items in training interaction when evaluating based on ranking
[馃悰BUG] Handling scores on training items when evaluating based on ranking
Apr 23, 2024
Here, you described that you set the scores of training items to negative infinity for top-k prediction.
However, dataloader.general_dataloader.FullSortEvalDatalLoader.collate_fn returns None as history unless is_sequential is true.
Therefore trainer.Trainer._full_sort_batch_eval can not use history_index to mask scores into -infinity.
Would you please clarify how masking works?
The text was updated successfully, but these errors were encountered: