Which strategy is used for negative sampling?? #1833
-
Hello, Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @tripledoubleE, thanks for your attention to RecBole! In RecBole, we support three commonly used negative sampling methods, including random negative sampling (RNS), popularity-biased negative sampling (PNS) and dynamic negative sampling (DNS). Training Settings — RecBole 1.1.1 documentation RecBole samples If you have any usage issues with our library, we suggest that you open a new issue instead of a discussion, so that we can better answer your questions. |
Beta Was this translation helpful? Give feedback.
Hello @tripledoubleE, thanks for your attention to RecBole!
In RecBole, we support three commonly used negative sampling methods, including random negative sampling (RNS), popularity-biased negative sampling (PNS) and dynamic negative sampling (DNS).
Training Settings — RecBole 1.1.1 documentation
RecBole samples
num
negative items for each user in a batch. We first implementget_used_ids
to obtainused_ids
, which are composed of positive items. When negative sampling, we will not sample from these items. Then we implementself.sampling
to sample negative items. If the distribution is uniform, the negative items will be sampled bynp.random.randint
in a uniform distribution. Else if the d…