Sr Gnn

[AAAI 2019] Source code and datasets for "Session-based Recommendation with Graph Neural Networks"
Alternatives To Sr Gnn
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Fl_chart5,928716a day ago87June 10, 2023239mitDart
FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
Ogb1,721222 months ago19November 02, 202219mitPython
Benchmark datasets, data loaders, and evaluators for graph machine learning
Cogdl1,43715 months ago17June 01, 202234mitPython
CogDL: A Comprehensive Library for Graph Deep Learning (WWW 2023)
a year ago1gpl-3.0Python
A parallel implementation of "graph2vec: Learning Distributed Representations of Graphs" (MLGWorkshop 2017).
Stgcn_ijcai 18723
7 months ago9bsd-2-clausePython
[IJCAI'18] Spatio-Temporal Graph Convolutional Networks
Knowledge Graph Learning662
8 months ago336mit
A curated list of awesome knowledge graph tutorials, projects and communities.
Sr Gnn607
2 years ago6Python
[AAAI 2019] Source code and datasets for "Session-based Recommendation with Graph Neural Networks"
a year ago22mitPython
Convolutional 2D Knowledge Graph Embeddings resources
3 years ago24mitPython
KGAT: Knowledge Graph Attention Network for Recommendation, KDD2019
5 months ago12otherJupyter Notebook
Cleora AI is a general-purpose model for efficient, scalable learning of stable and inductive entity embeddings for heterogeneous relational data.
Alternatives To Sr Gnn
Select To Compare

Alternative Project Comparisons


Paper data and code

This is the code for the AAAI 2019 Paper: Session-based Recommendation with Graph Neural Networks. We have implemented our methods in both Tensorflow and Pytorch.

Here are two datasets we used in our paper. After downloaded the datasets, you can put them in the folder datasets/:

There is a small dataset sample included in the folder datasets/, which can be used to test the correctness of the code.

We have also written a blog explaining the paper.


You need to run the file datasets/ first to preprocess the data.

For example: cd datasets; python --dataset=sample

usage: [-h] [--dataset DATASET]

optional arguments:
  -h, --help         show this help message and exit
  --dataset DATASET  dataset name: diginetica/yoochoose/sample

Then you can run the file pytorch_code/ or tensorflow_code/ to train the model.

For example: cd pytorch_code; python --dataset=sample

You can add the suffix --nonhybrid to use the global preference of a session graph to recommend instead of the hybrid preference.

You can also change other parameters according to the usage:

usage: [-h] [--dataset DATASET] [--batchSize BATCHSIZE]
               [--hiddenSize HIDDENSIZE] [--epoch EPOCH] [--lr LR]
               [--lr_dc LR_DC] [--lr_dc_step LR_DC_STEP] [--l2 L2]
               [--step STEP] [--patience PATIENCE] [--nonhybrid]
               [--validation] [--valid_portion VALID_PORTION]

optional arguments:
  -h, --help            show this help message and exit
  --dataset DATASET     dataset name:
  --batchSize BATCHSIZE
                        input batch size
  --hiddenSize HIDDENSIZE
                        hidden state size
  --epoch EPOCH         the number of epochs to train for
  --lr LR               learning rate
  --lr_dc LR_DC         learning rate decay rate
  --lr_dc_step LR_DC_STEP
                        the number of epochs after which the learning rate
  --l2 L2               l2 penalty
  --step STEP           gnn propogation steps
  --patience PATIENCE   the number of epoch to wait before early stop
  --nonhybrid           only use the global preference to predict
  --validation          validation
  --valid_portion VALID_PORTION
                        split the portion of training set as validation set


  • Python 3
  • PyTorch 0.4.0 or Tensorflow 1.9.0

Other Implementation for Reference

There are other implementation available for reference:

  • Implementation based on PaddlePaddle by Baidu [Link]
  • Implementation based on PyTorch Geometric [Link]
  • Another implementation based on Tensorflow [Link]
  • Yet another implementation based on Tensorflow [Link]


Please cite our paper if you use the code:

title = {{Session-based Recommendation with Graph Neural Networks}},
author = {Wu, Shu and Tang, Yuyuan and Zhu, Yanqiao and Wang, Liang and Xie, Xing and Tan, Tieniu},
year = 2019,
booktitle = {Proceedings of the Twenty-Third AAAI Conference on Artificial Intelligence},
location = {Honolulu, HI, USA},
month = jul,
volume = 33,
number = 1,
series = {AAAI '19},
pages = {346--353},
url = {},
doi = {10.1609/aaai.v33i01.3301346},
editor = {Pascal Van Hentenryck and Zhi-Hua Zhou},
Popular Graph Projects
Popular Dataset Projects
Popular Computer Science Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Machine Learning
Recommender System