RGCN for heterographs

Firstly, I wanted to thank all of you for creating this wonderful library for Graph computations. I am working on link prediction task with RGCNs involving a heterogeneous network with 3 kinds of nodes and several kinds of relationships between the nodes. I am closely following two examples to achieve my goal:

  1. RGCN
  2. RGCN-hetero

My first question is whether in the rgcn-hetero example if it is possible for node attributes for each node type to have different dimensions? (are there any tutorials for this?)

Secondly, I am trying to write my own model class LinkPredict with heterographs similar to example 1 but by modifying example 2 which has a EntityClassify task. If I understand this correctly, I would need to modify the Input 2 Hidden (i2h) layer to take into account different input node attribute sizes for my 3 different node types. Currently it seems to me that in_feat is common for ALL node types?

Sorry if my questions are a little naive. I’m just starting out with DGL. Many thanks!

That’s very possible and is one of the reasons why we put many efforts in supporting heterogeneous graphs. Just set your node attributes using the nodes[ntype].data[name] syntax.

G = ... # some heterograph
G.nodes['user'].data['h'] = torch.randn((g.number_of_nodes('user'), 5))  # dim=5
G.nodes['item'].data['h'] = torch.randn((g.number_of_nodes('item'), 3))  # dim=3

That’s very correct.

Thanks a lot for the quick and informative reply. It’s really very reassuring to get your input on this.
One of the reasons I really like the DGL library is because of this very active community here. Keep up the great work!