StellarGraph demos

StellarGraph provides numerous algorithms for graph machine learning. This folder contains demos of all of them to explain how they work and how to use them as part of a TensorFlow Keras data science workflow.

The demo notebooks can be run without any installation of Python by using Binder or Google Colab - these both provide a cloud-based notebook environment. The whole set of demos can be opened in Binder Open in Binder or you can click the Binder and Colab badges within each notebook.

Find algorithms for a task

  • Introduction to StellarGraph and its graph machine learning workflow (with TensorFlow and Keras): GCN on Cora

  • Predicting attributes, such as classifying as a class or label, or regressing to calculate a continuous number:

  • Representation learning or computing embedding vectors (including unsupervised tasks):

    • For nodes/vertices/entities, edges/links/connections and graphs: embeddings

  • Time series or sequence prediction for nodes within a graph (including spatio-temporal data): time series

  • Ensembling models to reduce prediction variance: ensembles

  • Loading data into a StellarGraph object, with Pandas, NumPy, Neo4j or NetworkX: basics

  • Experimental: running GraphSAGE or Cluster-GCN on data stored in Neo4j: neo4j connector

Find a demo for an algorithm

Algorithm

Heterogeneous

Directed

Edge weights

Time-varying, temporal

Node features

Node classification

Link prediction

Unsupervised

Inductive

Graph classification

Graph Convolutional Network (GCN)

see RGCN

yes

see T-GCN

yes

demo

demo

UnsupervisedSampler, DeepGraphInfomax

via Cluster-GCN

demo

Cluster-GCN

yes

yes

demo

yes

DeepGraphInfomax

yes

Relational GCN (RGCN)

multiple edges types

yes

yes

demo

yes

DeepGraphInfomax

Temporal GCN (T-GCN), implemented as GCN-LSTM

node features

time series, sequence

demo

Graph ATtention Network (GAT)

yes

yes

demo

yes

UnsupervisedSampler, DeepGraphInfomax

via Cluster-GCN

Simplified Graph Convolution (SGC)

yes

yes

demo

yes

Personalized Propagation of Neural Predictions (PPNP)

yes

yes

demo

yes

UnsupervisedSampler, DeepGraphInfomax

Approximate PPNP (APPNP)

yes

yes

demo

yes

UnsupervisedSampler, DeepGraphInfomax

via Cluster-GCN

GraphWave

via embedding vectors

via embedding vectors

demo

Attri2Vec

yes

demo

demo

demo

yes

GraphSAGE

see HinSAGE

demo

yes

yes

demo

demo

UnsupervisedSampler, DeepGraphInfomax

demo

HinSAGE

yes

yes

yes

demo

DeepGraphInfomax

yes

Node2Vec

demo

via embedding vectors, keras layer, gensim

via embedding vectors

keras layer, gensim

Metapath2Vec

yes

via embedding vectors

via embedding vectors

demo

Continuous-Time Dynamic Network Embeddings

yes

via embedding vectors

via embedding vectors

yes

Watch Your Step

yes

via embedding vectors

via embedding vectors

demo

ComplEx

multiple edges types

yes

via embedding vectors

demo

yes

DistMult

multiple edges types

yes

via embedding vectors

demo

yes

Deep Graph CNN

yes

yes

demo

See the root README or each algorithm’s documentation for the relevant citation(s).

Download the demos

You can run download a local copy of the demos using the curl command below:

curl -L https://github.com/stellargraph/stellargraph/archive/master.zip | tar -xz --strip=1 stellargraph-master/demos

The dependencies required to run most of our demo notebooks locally can be installed using one of the following:

  • Using pip: pip install stellargraph[demos]

  • Using conda: conda install -c stellargraph stellargraph

Table of contents