From dbaeb5f19d5facaf29b2fcdfa7b561d48fa56db1 Mon Sep 17 00:00:00 2001 From: zbw <18735382001@163.com> Date: Sat, 23 Sep 2023 15:54:43 +0800 Subject: [PATCH] FIX: fix the bug in negative sampling. --- recbole/data/dataloader/abstract_dataloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recbole/data/dataloader/abstract_dataloader.py b/recbole/data/dataloader/abstract_dataloader.py index 5bc630b94..afa39a213 100644 --- a/recbole/data/dataloader/abstract_dataloader.py +++ b/recbole/data/dataloader/abstract_dataloader.py @@ -137,7 +137,7 @@ def _set_neg_sample_args(self, config, dataset, dl_format, neg_sample_args): self.times = 1 if ( self.neg_sample_args["distribution"] == "uniform" - or "popularity" + or self.neg_sample_args["distribution"] == "popularity" and self.neg_sample_args["sample_num"] != "none" ): self.neg_sample_num = self.neg_sample_args["sample_num"]