Skip to content

Which strategy is used for negative sampling?? #1833

Answered by Sherry-XLL
tripledoubleE asked this question in Q&A
Discussion options

You must be logged in to vote

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 implement get_used_ids to obtain used_ids, which are composed of positive items. When negative sampling, we will not sample from these items. Then we implement self.sampling to sample negative items. If the distribution is uniform, the negative items will be sampled by np.random.randint in a uniform distribution. Else if the d…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tripledoubleE
Comment options

Answer selected by tripledoubleE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants