Deep Learning On Graphs

@eliaswalyba
Machine Learning Teacher & Engineer

Summary

  • Introduction
  • Neural nets and deep learning
  • Graphs are powerful modelers
  • Combining neural nets and graphs: how difficult ?
  • Graph neural networks: concepts and implementation
  • Conclusion

Resources

  • distill.pub
  • theaisummer.com/gnn-architectures
  • github.com/thunlp/GNNPapers
  • A Comprehensive Survey on Graph Neural Networks (arxiv.org/abs/1901.00596)
  • networksciencebook.com
  • tkipf.github.io/graph-convolutional-networks
  • Deep Learning for the Life Sciences (www.oreilly.com/library/view/deep-learning-for/9781492039822)
  • Graph Representation Learning (https://www.amazon.com/Representation-Learning-Synthesis-Artificial-Intelligence/dp/1681739631)
  • Semi-Supervised Classification with Graph Convolutional Networks (https://arxiv.org/abs/1609.02907)

Hold on ! before any further, are GNNs useful ?

  • Computer vision
  • NLP
  • Traffic
  • Drug discovery
  • Chemistry
  • Social Network Analysis
  • Information spread
  • Marketing
  • Crime scene analysis
  • Recommender Systems

Okay got it ! GNNs are interesting. Let's move forward.

Graphs are all around us

Graphs are all around us

Graphs are all around us

Graphs are all around us; real world objects are often defined in terms of their connections to other things.

 

A set of objects, and the connections between them, are naturally expressed as a graph.

Graphs are all around us

But ? What's a graph ?

Modeling with graphs

  • Graph centered models
  • Node centered models
  • Edge centered model

Overview of neural networks

G + NN Challenges 🥴

  • Data representation
  • Adjacency matrices are usually sparse
  • Adjency matrices are not (always) permutation invariant

So the light was 😇

What the heck is a GNN ?

Graph neural networks (GNNs) are a family of neural networks that can operate naturally on graph-structured data. By extracting and utilizing features from the underlying graph, GNNs can make more informed predictions about entities in these interactions, as compared to models that consider individual entities in isolation.

A GNN is an optimizable transformation on all attributes of the graph (nodes, edges, global-context) that preserves graph symmetries (permutation invariances)

What the heck is a GNN ?

Graph In, Graph Out !

Text

Text

Text

The structure doesn't change, only the embedding do.

GNN are very similar to Encoder-Decoder models.

Message-passing Algorithm

  1. For each node in the graph, gather all the neighboring node embeddings (or messages).
     
  2. Aggregate all messages via an aggregate function (like sum).
     
  3. All pooled messages are passed through an update function, usually a learned neural network.

Message-passing Algorithm

Sometimes predicting is easy

Example: When the model is node centered and we need to predict on nodes.

Sometimes, it ain't that straightforward !

We may need node information in edges and vice-versa.

Pooling algorithm

Collect information from nodes to edges and vice-versa.

  1. For each item to be pooled, gather each of their embeddings and concatenate them into a matrix.
     
  2. The gathered embeddings are then aggregated, usually via a sum operation.

Edge centered to Node prediction

Pooling algorithm

Node centered to Edge prediction

Pooling algorithm

Node & Edge centered to Global State prediction

Pooling algorithm

End-to-end (simple) GNN model

  • The classification mode can be replaced by any differentiable model
  • Pooling and message passing allow us to build more sophisticated GNN models and pipelines.

More about representation learning

  • The dataset usually doesn't contain both node and edge information
  • Learn a linear mapping between nodes and edges

More challenges

  • Other types of graphs (multigraphs, hypergraphs, ...)
  • Sampling and batching
  • Inductive biases
  • Aggregation operations

The wild world of GNNs

  • Spectral Networks
  • ChebNets
  • Graph Convolutional Networks (GCN)
  • Graph Attention Networks (GAT)

More about GCN

More about GAT

Conclusion

Graphs are beast modelers. Neural networks are witch predictors. Graph neural networks are the kids of their mariage.

😎

What's better than code ?

Let's implement a simple GNN using Keras

Deep learning on graphs

By Elias W. BA

Deep learning on graphs

  • 46