Coder Social home page Coder Social logo

zhongpeixiang / m2grl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 99731/m2grl

0.0 2.0 0.0 69 KB

A demo code of KDD2020 paper "M2GRL: A Multi-task Multi-view Graph Representation Learning Framework for Web-scale Recommender Systems"

Home Page: https://arxiv.org/abs/2005.10110

Python 100.00%

m2grl's Introduction

M2GRL

This is a demo of the M2GRL framework, which is designed for learning node representations from multi-view graphs for web-scale recommender Recommender systems.

For more details, please refer to our KDD2020 paper "M2GRL: A Multi-task Multi-view Graph Representation Learning Framework for Web-scale Recommender Systems"

Contact: Menghan Wang ([email protected])

Requirements

  • python version: 2.7

  • tensorflow verison: 1.8

Data format

A typical example of data has six columns: 'src_ids', 'dst_ids', 'src_id', 'dst_id', 'type', 'neg_ids'

'type': an integer indicates which task this data sample belongs to. The mapping configuration is defined in const.py (the key of dict TASK_CONFIG). 'src_id': the first element of data pair ('src_id','dst_id'). 'dst_id': the second element of data pair ('src_id','dst_id'). 'neg_ids': the sampled negative ids. 'src_ids': a fixed-length sequence of 'src_id', designed for efficient training. 'dst_ids': a fixed-length sequence of 'dst_id', designed for efficient training.

Note that in practice we aggregate data pairs by src_id and generate 'src_ids' and 'dst_ids'.

Below is an example in reader.py.

features={
            'src_ids': tf.FixedLenFeature([FLAGS.window_size*2], tf.int64),
            'dst_ids': tf.FixedLenFeature([FLAGS.window_size*2], tf.int64),
            'src_id': tf.FixedLenFeature([], tf.int64),
            'dst_id': tf.FixedLenFeature([], tf.int64),
            'type': tf.FixedLenFeature([], tf.int64),
            'neg_ids': tf.FixedLenFeature([20], tf.int64),
        })

How to set task settings

Configurations of tasks and views are in the const.py, where a sample config is given.

How to run M2GRL

  1. run command python reader.py to generate example data.

  2. run command python local_main.py to run the model. Set FLAGS.mode = "train" to train the model and FLAGS.mode = "export" to get the learned representations.

Citation

Please cite our paper if it is helpful to your research:

@article{DBLP:journals/corr/abs-2005-10110,
  author    = {Menghan Wang and
               Yujie Lin and
               Guli Lin and
               Keping Yang and
               Xiao{-}Ming Wu},
  title     = {{M2GRL:} {A} Multi-task Multi-view Graph Representation Learning Framework
               for Web-scale Recommender Systems},
  journal   = {CoRR},
  volume    = {abs/2005.10110},
  year      = {2020},
  url       = {https://arxiv.org/abs/2005.10110},
  archivePrefix = {arXiv},
  eprint    = {2005.10110},
  timestamp = {Fri, 22 May 2020 16:21:28 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/abs-2005-10110.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

m2grl's People

Contributors

99731 avatar

Watchers

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