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.
- Compatible with PyTorch 1.8.2 and Python 3.8.
- Dependencies can be installed using
requirements.txt
.
-
data
- gowalla, yelp, amazoni
-
d
- embedding size
-
m, model
- 0:
matrix factorization
- 1:
NCF
- 2:
GMF
- 3:
MLP
- 4:
LightGCN
- 0:
-
sampler
- 0:
uniform
- 2:
AdaSIR uniform
- 3:
popularity
- 5:
AdaSIR pop
- 0:
-
loss_type
- 0:
AdaSIR
- 1:
DNS(M, N)
- 2:
Softmax(\rho, N)
- 0:
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)
The project is built upon AdaSIR
For any clarification, comments, or suggestions please create an issue or contact me.