Giter Site home page Giter Site logo

www_2023_code's Introduction

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: The dataset to use, which can be:
    • gowalla
    • yelp
    • amazoni
  • d: The embedding size
  • m: The model to use, which can be:
    • 0: matrix factorization
    • 1: NCF
    • 2: GMF
    • 3: MLP
    • 4: LightGCN
  • sampler: The sampling method to use, which can be:
    • 0: uniform
    • 2: AdaSIR uniform
    • 3: popularity
    • 5: AdaSIR pop
  • loss_type: The loss function to use, which can be:
    • 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.

www_2023_code's People

Contributors

hungpaan avatar junkangwu avatar lyc0930 avatar sai990323 avatar swt-user avatar zhuhsingyuu avatar zzhustc2016 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.