From f1034280b59c1fd06fc4720ddfdcea63e9143570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ch=C3=A9ngl=C3=B3ng=20M=C7=8E?= <33501679+ChenglongMa@users.noreply.github.com> Date: Wed, 13 Sep 2023 21:40:59 +1000 Subject: [PATCH] Update abstract_dataloader.py Fix `if` condition in `set_neg_sample_args` function. In the current version, the `if` condition is still `true` when `distribution` is `uniform` but `sample_num` is `none`. --- recbole/data/dataloader/abstract_dataloader.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recbole/data/dataloader/abstract_dataloader.py b/recbole/data/dataloader/abstract_dataloader.py index 5bc630b94..21a8ce840 100644 --- a/recbole/data/dataloader/abstract_dataloader.py +++ b/recbole/data/dataloader/abstract_dataloader.py @@ -136,8 +136,7 @@ def _set_neg_sample_args(self, config, dataset, dl_format, neg_sample_args): self.neg_sample_args = neg_sample_args self.times = 1 if ( - self.neg_sample_args["distribution"] == "uniform" - or "popularity" + self.neg_sample_args["distribution"] in ["uniform", "popularity"] and self.neg_sample_args["sample_num"] != "none" ): self.neg_sample_num = self.neg_sample_args["sample_num"]