Giter Club home page Giter Club logo

graphsage-tf2's Introduction

Yet Another GraphSage Implementation in TensorFlow2

GraphSAGE (original implementation): https://github.com/williamleif/GraphSAGE

Simple Implementation for Studying Purpose

This is another GraphSAGE implementation

  • Simplifying things for studying purpose
    • MeanAggregator only
    • CPU runtime only
  • Python 3
  • TensorFlow 2

How to Run

Supervised Version

It requires python3 with both tensorflow and scikit-learn packages.

./supervised.py

Unsupervised Version

./unsupervised.py

Design Choices

  1. Computing diffusion matrix and bitmask for node feature and neighbor concatenation outside TensorFlow (in minibatch.py) since this is faster. Tried to write this part inside tensorflow but got 50x slower (branch #internaldiffusion) not using tf.function. It seems too complicated to get rid of python dict and use only matrices and tf.function, which I haven't tested.
  2. fit and fit_generator in tf.keras.Model do not support more than one arguments, so I manually write the training loop with tf.GradientTape().

Prilimary Performance Evaluation (CPU)

The supervised part is 35% faster than graphsage-simple (PyTorch version of GraphSage)

  • cora dataset, minibatch size 256 units, average batch time on a 32-vcore testbed:
  • graphsage-simple updated version: 0.03806s
  • graphsage-tf2 (this one): 0.02408s

This unsupervised part is much slower than GraphSage original implementation and cannot parallelize well with multi-core CPU. It is under investigation.

graphsage-tf2's People

Contributors

subbyte avatar

Forkers

mqxiaoxiaoma

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.