Giter Site home page Giter Site logo

linxyhaha / equal Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 105.08 MB

Implementation of paper: Equivariant Learning for Out-of-Distribution Cold-start Recommendation. (backbone model CLCRec) (MM'23)

Python 98.59% Shell 1.41%
cold-start distribution-shift equivariant-representations pytorch recommender-system

equal's Introduction

Equivariant Learning for Out-of-Distribution Cold-start Recommendation

This is the pytorch implementation of our paper

Equivariant Learning for Out-of-Distribution Cold-start Recommendation

Environment

  • Anaconda 3
  • python 3.7.11
  • pytorch 1.10.0
  • numpy 1.21.4

Usage

Data

The experimental data are in './data' folder.

Training

python main.py --model_name=$1 --data_path=$2 --batch_size=$3 --l_r=$4 --reg_weight=$5 --num_neg=$6 --lr_lambda=$7 --num_sample=$8 --temp_value=$9 --dim_E=$10 --alpha=$11 --pos_ratio=$12 --neg_ratio=$13 --align_all=$14 --mse_weight=$15 --log_name=$16 --gpu=$17

or use run.sh

sh run.sh CLCRec micro-video 256 0.001 0.001 512 0.1 0.7 1 128 0.9 0.1 0.1 0 0.01 log 0
  • The log file will be in the './code/log/' folder.
  • The explanation of hyper-parameters can be found in './code/main.py'.
  • The default hyper-parameter settings are detailed in './code/hyper-parameters.txt'.

Inference

Get the results of EQUAL with Implicit Alignment Module (IAM) by running inference.py:

python inference.py --backmodel=$1 --drop_obj=$2 --dropout=$3 --topN=$4 --log_name=$5 --gpu=$6

or use inference.sh

sh inference.sh CLCRec model [0,0.05,0.1,0.15,0.2] 100 log 0

The explanation of hyper-parameters can be found in './code/inference.py'. The default hyper-parameter settings are detailed in './code/hyper-parameters.txt'.

Examples

  1. Train EQUAL on micro-video:
cd ./code
sh run.sh CLCRec micro-video 256 0.001 0.001 512 0.1 0.7 1 128 0.9 0.1 0.1 0 0.01 log 0
  1. Inference on Amazon:
cd ./code
python inference.py --backmodel CLCRec --drop_obj model --dropout [0,0.05,0.1,0.15,0.2] --topN 50 --log_name log --gpu 0

equal's People

Stargazers

 avatar  avatar

Watchers

 avatar

equal's Issues

Complete dataset and key parameters

This is a very interesting piece of work that considers the cold start problem from the perspective of feature migration.

However, when I run the code, both datasets you provided do not run successfully, where it seems micro-video is missing key files such as validation_dict.npy; in addition, the Amazon dataset will run incorrectly due to inconsistencies in parameter inputs causing runtime errors in the calculations;

Would you mind double-checking that the key parameters of the uploaded code are consistent with the paper that
In other words, can you successfully run the code that has been uploaded?

Also, would you mind uploading the full micro-video dataset to facilitate community research?

Looking forward to your reply!😘

Kwai Dataset?

Thank you very much for your excellent work. Can you provide the complete Kwai dataset? If you are unable to release it due to copyright reasons, you can choose to send it to my email at [email protected]. Thank you very much.

user_embedding

请问Dataset.py中下面的嵌入如何获取,似乎是运行某个模型预训练得到的,期待你的回答。
best_user_embedding = np.load(dir_str+'/user_embedding.npy', allow_pickle=True)
best_item_embedding = np.load(dir_str+'/item_embedding.npy', allow_pickle=True)

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.