Continuous-Time Sequential Recommendation with Temporal Graph Collaborative Transformer

Overview

Introduction

This is the repository of our accepted CIKM 2021 paper "Continuous-Time Sequential Recommendation with Temporal Graph Collaborative Transformer" and the proposed model is TGSRec. Paper is available on arxiv

Citation

Please cite our paper if using this code.

@inproceedings{fan2021continuous,
  title={Continuous-Time Sequential Recommendation with Temporal Graph Collaborative Transformer},
  author={Fan, Ziwei and Liu, Zhiwei and Zhang, Jiawei and Xiong, Yun and Zheng, Lei and Yu, Philip S.},
  booktitle={Proceedings of the 30th ACM International Conference on Information and Knowledge Management},
  year={2021},
  organization={ACM}
}

Implementation

TO BE CONTINUED

Comments
  • some questions about TGSRec!

    some questions about TGSRec!

    TGSRec model is very nice and fancy, but I have some questions about your open code as follows:

    1. Here, I think left should add one more, because neighbors_idx[left] must small than neighbors_idx, right? https://github.com/DyGRec/TGSRec/blob/9b61480db2a18a752a79f16df7bdd17c749cdd70/graph.py#L87
    2. I think this will sample some neightbors more than one time when len(ngh_idx) is smaller than num_neighbors, and I think this will lead bad influence... https://github.com/DyGRec/TGSRec/blob/9b61480db2a18a752a79f16df7bdd17c749cdd70/graph.py#L108
    3. why not directly use inner product but affinity_score here where I think it is not match your paper, right? https://github.com/DyGRec/TGSRec/blob/9b61480db2a18a752a79f16df7bdd17c749cdd70/model.py#L478
    4. there is only node_hist_embed without time embedding parameter like your paper said? https://github.com/DyGRec/TGSRec/blob/9b61480db2a18a752a79f16df7bdd17c749cdd70/run_TGREC.py#L181-L184
    5. it didn't use sin but only cos, but use both of them in your paper? https://github.com/DyGRec/TGSRec/blob/9b61480db2a18a752a79f16df7bdd17c749cdd70/model.py#L249
    6. why the matric of SYSRec、BERT4Rec etc. is so low where I think it doesnot match the ranking in https://paperswithcode.com/sota/collaborative-filtering-on-movielens-1m althogh it uses 1m not 100k dataset?
    7. I think off_set_l[src_idx+1] here may happen index out of range when src_idx is max. https://github.com/DyGRec/TGSRec/blob/9b61480db2a18a752a79f16df7bdd17c749cdd70/graph.py#L66 help me please!!!
    opened by TangJiakai 12
  • Torch bur not TensorFlow?

    Torch bur not TensorFlow?

    Hi,I am a student interested in your paper and code,but found that your code is actually run on Torch but not TensorFlow. But in your readme.MD, it is any problem with TensorFlow 1.1.2? Pardon me for my poor English! Looking forward to your reply!

    opened by haidequanbu 1
  • Trouble running the code

    Trouble running the code

    Hi I'm a student and in attempting to understand your code I cloned the repository and ran the sample command at the bottom of the readme. I got the following error. I understand that this CSV file is created in the process.py file but even that file refers to './processed/ml{}.csv'. which is not present in the repository. I was wondering if I missed a critical step. Sorry if this comes across as a silly question

    data.py", line 11, in init g_df = pd.readcsv('./processed/ml{}.csv'.format(DATASET)) FileNotFoundError: [Errno 2] No such file or directory: './processed/ml_ml-100k.csv'

    Thanks

    opened by rajkumar464 3
  • What's the key difference between TGSRec and TGAN?

    What's the key difference between TGSRec and TGAN?

    Hi, there

    I carefully read the paper, and there is one thing that really makes me confused: what's the key difference between TGSRec and TGAN?

    After reading the public codes line by line, it seems that the major difference is whether to use the edge features or not?

    Could you kindly provide more comments to help me better interpret the insights of TGSRec, please?

    Thanks

    opened by cchao0116 0
  • Datasets are not sorted by time, model uses information from the future

    Datasets are not sorted by time, model uses information from the future

    I went through the code and one thing is bothering me. I think there is a major bug in the implementation. It is possible that I don't understand something, so please correct me if I'm wrong, but as of my current understanding this code trains and validates using the information "from the future" .

    If you examine values in the code below you will see that there negative values for the delta. https://github.com/DyGRec/TGSRec/blob/0c7ba17b1b787648ac0af0b57dfc7b91f2f00654/model.py#L557

    I can see that mask is created only for the 0 values so negatives values are still used. https://github.com/DyGRec/TGSRec/blob/0c7ba17b1b787648ac0af0b57dfc7b91f2f00654/model.py#L575

    Data here is sorted by edge_ids not timestamps, so the possible fix for that would by sorting by x[2], instead of x[1] https://github.com/DyGRec/TGSRec/blob/0c7ba17b1b787648ac0af0b57dfc7b91f2f00654/graph.py#L34-L39

    If you look at the: TGSRec/datasets/ml-100k/u.data

    data is not sorted, by the timestamp and there is no point in your codebase, where this sorting happens (I guess).

    I tried to run experiments for ml-100 for both scenarios: your original implementation and with the sorted input data and the results I got are significantly worse, at least for the early stages of training. I haven't run it for 200 epochs, so maybe the final results are closer to each other, but firstly I would like to see if my assumption is correct.

    Results afters 20 epochs: Without sorting:

    valid acc: 0.7069337926425662
    valid auc: 0.8038448618385599
    valid f1: 0.7070636805233961
    valid ap: 0.8172432697828477
    

    With sorting:

    valid acc: 0.5271334211112526
    valid auc: 0.7374971517076878
    valid f1: 0.6789490018391757
    valid ap: 0.7001478155001294
    
    opened by artursil 4
Owner
SeqRec
SeqRec
Collaborative variational bandwidth auto-encoder (VBAE) for recommender systems.

Collaborative Variational Bandwidth Auto-encoder The codes are associated with the following paper: Collaborative Variational Bandwidth Auto-encoder f

Yaochen Zhu 14 Dec 11, 2022
A Python implementation of LightFM, a hybrid recommendation algorithm.

LightFM Build status Linux OSX (OpenMP disabled) Windows (OpenMP disabled) LightFM is a Python implementation of a number of popular recommendation al

Lyst 4.2k Jan 2, 2023
A TensorFlow recommendation algorithm and framework in Python.

TensorRec A TensorFlow recommendation algorithm and framework in Python. NOTE: TensorRec is not under active development TensorRec will not be receivi

James Kirk 1.2k Jan 4, 2023
Persine is an automated tool to study and reverse-engineer algorithmic recommendation systems.

Persine, the Persona Engine Persine is an automated tool to study and reverse-engineer algorithmic recommendation systems. It has a simple interface a

Jonathan Soma 87 Nov 29, 2022
ToR[e]cSys is a PyTorch Framework to implement recommendation system algorithms

ToR[e]cSys is a PyTorch Framework to implement recommendation system algorithms, including but not limited to click-through-rate (CTR) prediction, learning-to-ranking (LTR), and Matrix/Tensor Embedding. The project objective is to develop a ecosystem to experiment, share, reproduce, and deploy in real world in a smooth and easy way (Hope it can be done).

LI, Wai Yin 90 Oct 8, 2022
A framework for large scale recommendation algorithms.

A framework for large scale recommendation algorithms.

Alibaba Group - PAI 880 Jan 3, 2023
Recommendation System to recommend top books from the dataset

recommendersystem Recommendation System to recommend top books from the dataset Introduction The recom.py is the main program code. The dataset is als

Vishal karur 1 Nov 15, 2021
An open source movie recommendation WebApp build by movie buffs and mathematicians that uses cosine similarity on the backend.

Movie Pundit Find your next flick by asking the (almost) all-knowing Movie Pundit Jump to Project Source » View Demo · Report Bug · Request Feature Ta

Kapil Pramod Deshmukh 8 May 28, 2022
Implementation of a hadoop based movie recommendation system

Implementation-of-a-hadoop-based-movie-recommendation-system 通过编写代码,设计一个基于Hadoop的电影推荐系统,通过此推荐系统的编写,掌握在Hadoop平台上的文件操作,数据处理的技能。windows 10 hadoop 2.8.3 p

汝聪(Ricardo) 5 Oct 2, 2022
Books Recommendation With Python

Books-Recommendation Business Problem During the last few decades, with the rise

Çağrı Karadeniz 7 Mar 12, 2022
Bert4rec for news Recommendation

News-Recommendation-system-using-Bert4Rec-model Bert4rec for news Recommendation

saran pandian 2 Feb 4, 2022
E-Commerce recommender demo with real-time data and a graph database

?? E-Commerce recommender demo ?? This is a simple stream setup that uses Memgraph to ingest real-time data from a simulated online store. Data is str

g-despot 3 Feb 23, 2022
Graph Neural Networks for Recommender Systems

This repository contains code to train and test GNN models for recommendation, mainly using the Deep Graph Library (DGL).

null 217 Jan 4, 2023
Leveraging Two Types of Global Graph for Sequential Fashion Recommendation, ICMR 2021

This is the repo for the paper: Leveraging Two Types of Global Graph for Sequential Fashion Recommendation Requirements OS: Ubuntu 16.04 or higher ver

Yujuan Ding 10 Oct 10, 2022
Python Implementation of algorithms in Graph Mining, e.g., Recommendation, Collaborative Filtering, Community Detection, Spectral Clustering, Modularity Maximization, co-authorship networks.

Graph Mining Author: Jiayi Chen Time: April 2021 Implemented Algorithms: Network: Scrabing Data, Network Construbtion and Network Measurement (e.g., P

Jiayi Chen 3 Mar 3, 2022
A PaddlePaddle implementation of Time Interval Aware Self-Attentive Sequential Recommendation.

TiSASRec.paddle A PaddlePaddle implementation of Time Interval Aware Self-Attentive Sequential Recommendation. Introduction 论文:Time Interval Aware Sel

Paddorch 2 Nov 28, 2021
MLOps will help you to understand how to build a Continuous Integration and Continuous Delivery pipeline for an ML/AI project.

page_type languages products description sample python azure azure-machine-learning-service azure-devops Code which demonstrates how to set up and ope

null 1 Nov 1, 2021
Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation, available for both PyTorch and Tensorflow.

Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation, available for both PyTorch and Tensorflow.

null 730 Jan 9, 2023
Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation, available for both PyTorch and Tensorflow.

Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation, available for both PyTorch and Tensorflow.

null 730 Jan 9, 2023
Locally Constrained Self-Attentive Sequential Recommendation

LOCKER This is the pytorch implementation of this paper: Locally Constrained Self-Attentive Sequential Recommendation. Zhankui He, Handong Zhao, Zhe L

Zhankui (Aaron) He 8 Jul 30, 2022