HeteroGraphConv and RelGraphConv

Hi,
I have two questions.

  1. What is the difference between HeteroGraphConv and RelGraphConv? Do they perform the same?
  2. How does “GraphConv in HeteroGraphConv” or “RelGraphConv” handle?
    if the nodes at both ends of a relationship are not homogeneous, are they regarded as homogeneous nodes? like this
    self.conv1 = dglnn.HeteroGraphConv({
    ‘nodeA_nodeA’:dglnn.GraphConv(in_feats,hid_feats),
    ‘nodeB_nodeB’:dglnn.GraphConv(in_feats,hid_feats),
    ’nodeA_nodeB’:dglnn.GraphConv(in_feats,hid_feats)
    }, aggregate=‘sum’)
  1. RelGraphConv is a relational graph convolution layer for homogeneous graphs. HeteroGraphConv is a generic module for computing convolution on heterogeneous graphs and you’re free to apply different sub-modules(namely convolution layer) on each relation(edge_type) in this heterograph.
  2. homogeneous and heterogeneous are for graph, not nodes. GraphConv is the graph convolution layer no matter whether it’s used in HeteroGraphConv or used directly. Please refer to GraphConv — DGL 0.8.1 documentation for more details and examples.


This is my graph which I wish to predict if “r1” exists. I think it’s a heterogeneous graph. I wish to apply some kind of graph tool to get node features. Can I use RelGraphConv?
Now I am currently doing like:
self.conv1 = dglnn.HeteroGraphConv({
‘nodeA_nodeA’:dglnn.GraphConv(in_feats,hid_feats),
‘nodeB_nodeB’:dglnn.GraphConv(in_feats,hid_feats),
’nodeA_nodeB’:dglnn.GraphConv(in_feats,hid_feats)
}, aggregate=‘sum’)

Is this correct? It’s not clear to me if GraphConv can be used for triple (nodeA, r1, nodeB).

Yes, it’s ok for ’nodeA_nodeB’:dglnn.GraphConv(in_feats,hid_feats).