Skip to content

SAI990323/WWW_2023_code

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation for DNS(M,N) and Softmax(\rho, N)

The Relationship between Hard Negative Sampling and TopK metrics

This is our PyTorch implementation for the paper 2023'WWW:

Wentao Shi, Jiawei Chen, Fuli Feng, Jizhi Zhang, Junkang Wu, Chongming Gao, Xiangnan He (2023) On the Theories behind Hard Negative Sampling for Recommendation. paper link. In WWW 2023.

Dependencies

  • Compatible with PyTorch 1.8.2 and Python 3.8.
  • Dependencies can be installed using requirements.txt.

Parameters

  • data

    • gowalla, yelp, amazoni
  • d

    • embedding size
  • m, model

    • 0: matrix factorization
    • 1: NCF
    • 2: GMF
    • 3: MLP
    • 4: LightGCN
  • sampler

    • 0: uniform
    • 2: AdaSIR uniform
    • 3: popularity
    • 5: AdaSIR pop
  • loss_type

    • 0: AdaSIR
    • 1: DNS(M, N)
    • 2: Softmax(\rho, N)

Running Example

python main_more.py --lambda_w 2 --sampler 0 --sample_num 200 --fix_seed --weighted --loss_type 1 for DNS(M, N)

python main_more.py --lambda_w 1 --sampler 0 --sample_num 200 --fix_seed --weighted --loss_type 2 for Softmax(\rho, N)

Acknowledgement

The project is built upon AdaSIR

For any clarification, comments, or suggestions please create an issue or contact me.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%