PyTorch Code to train a GCN/ RGCN w/ DGL-KE on a free SageMaker Studio Lab. Graph Convolution Network GCN Embedding calculated in real-time on a simple JupyterLab. Applying mighty Deep Graph Library (DGL) on Graphs (PyTorch).
Next step will be DGL-KE.
For each node, a RGCN layer performs the following steps:
1) Compute outgoing message using node representation and weight matrix associated with the edge type (message function)
2) Aggregate incoming messages and generate new node representations (reduce and apply function)
In simple terms: A relational graph convolutional network (RGCN) handles different relationships between entities in a knowledge base.
Compared to a classical GCN:
The straightforward graph convolutional network (GCN) exploits structural information of a dataset (that is, the graph connectivity) in order to improve the extraction of node representations. Graph edges are left as untyped.
Advance to a Knowledge Graph:
A knowledge graph is made up of a collection of triples in the form subject, relation, object. Edges thus encode important information and have their own edge embeddings to be learned. Plus there may exist multiple (!) edges among any given pair.
Both JupyterLabs are part of the official DGL tutorial presentation.
See https://docs.dgl.ai/en/latest/index.html
Full credits to DGL community!
Official Link to these JupyterLabs:
--------------------------------------------
https://docs.dgl.ai/en/0.6.x/_downloads/3c3026a1d47f007e05f4e833138c1b51/5_hetero.ipynbhttps://docs.dgl.ai/en/0.6.x/tutorials/basics/5_hetero.html
(Theoretical) Background on RGCN:
---------------------------------------------------------
https://docs.dgl.ai/en/latest/tutorials/models/1_gnn/4_rgcn.htmlhttps://github.com/dmlc/dgl/tree/master/examples/pytorch/rgcn-hetero
#GraphConvolutionNetwork
#DGL-Deep_Graph_Library
#Heterogeneous_Graphs
#graphs
#neuralnetworks
#ai
#machinelearningwithpython
#convolutionalneuralnetwork
#jupyterlab
#dgl
00:00 Node Classification with DGL
04:20 Graph Convolutional Network
07:00 Code for Training
08:50 Heterogeneous Graphs
11:50 Knowledge Graph
15:30 Relational GCN
17:30 Train RGCN code
5 Comments