Giter Club home page Giter Club logo

kgat-pytorch's Introduction

Knowledge Graph Attention Network

This is PyTorch & DGL implementation for the paper:

Xiang Wang, Xiangnan He, Yixin Cao, Meng Liu and Tat-Seng Chua (2019). KGAT: Knowledge Graph Attention Network for Recommendation. Paper in ACM DL or Paper in arXiv. In KDD'19, Anchorage, Alaska, USA, August 4-8, 2019.

You can find Tensorflow implementation by the paper authors here.

Introduction

Knowledge Graph Attention Network (KGAT) is a new recommendation framework tailored to knowledge-aware personalized recommendation. Built upon the graph neural network framework, KGAT explicitly models the high-order relations in collaborative knowledge graph to provide better recommendation with item side information.

If you want to use codes and datasets in your research, please contact the paper authors and cite the following paper as the reference:

@inproceedings{KGAT19,
  author    = {Xiang Wang and
               Xiangnan He and
               Yixin Cao and
               Meng Liu and
               Tat{-}Seng Chua},
  title     = {{KGAT:} Knowledge Graph Attention Network for Recommendation},
  booktitle = {{KDD}},
  pages     = {950--958},
  year      = {2019}
}

Environment Requirement

The code has been tested running under Python 3.6.8. The required packages are as follows:

  • torch == 1.3.1
  • dgl-cu90 == 0.4.1
  • numpy == 1.15.4
  • pandas == 0.23.1
  • scipy == 1.1.0
  • sklearn == 0.20.0

Run the Codes

  • FM
python main_nfm.py --model_type fm --dataset amazon-book
  • NFM
python main_nfm.py --model_type nfm --dataset amazon-book
  • BPRMF (train on multi-GPUs)
python -m torch.distributed.launch main_bprmf.py --dataset amazon-book
  • ECFKG (train on multi-GPUs)
python -m torch.distributed.launch main_ecfkg.py --dataset amazon-book
  • CKE (train on multi-GPUs)
python -m torch.distributed.launch main_cke.py --dataset amazon-book
  • KGAT
python main_kgat.py --dataset amazon-book

Results

With my code, following are the results of each model when training with dataset amazon-book.

Model Valid Data Best Epoch Precision@20 Recall@20 NDCG@20
FM sample 1000 test users 65 0.014400000683963299 0.14490722119808197 0.07221827559341328
NFM sample 1000 test users 56 0.013850000686943531 0.13833996653556824 0.0724611583347469
BPRMF all test users 65 0.014154779163154574 0.13356850621872207 0.06943918307731874
ECFKG all test users 41 0.013035656309061863 0.12247500353257905 0.06115661206228789
CKE all test users 52 0.014507515353912879 0.13836056015380443 0.07225836488142431
KGAT all test users 31 0.014817044902584718 0.14117674635791852 0.07526633940808744

Final results on all test users

Model Precision@20 Recall@20 NDCG@20
FM 0.0138 0.1309 0.0676
NFM 0.0131 0.1246 0.0655
BPRMF 0.0142 0.1336 0.0694
ECFKG 0.0130 0.1225 0.0612
CKE 0.0145 0.1384 0.0723
KGAT 0.0148 0.1412 0.0753

Related Papers

kgat-pytorch's People

Contributors

lunablack avatar luna-fu avatar

Watchers

James Cloos 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.