Node features and Edge properties for R-GCN

Hi, I’ve found DGL such an amazing tool for a GNN newbie like myself. This time I’d like to build a GCN model on a Heterogeneous graph with node features and edge properties.

I’m trying to figure out how to incorporate node features and edge properties into building a R-GCN model, but still struggling to find a right way to do it. The R-GCN tutorial code is about featureless inputs, so I’m wondering whether I can just replace those featureless input vectors with my own embedded node features, and also how to utilize edge properties (embedded edge features such as edge strength) as well.

If I can’t use R-GCN for this case, could you also recommend me other GNN models which can tackle a Heterogeneous graph with node and edge features?

Thanks in advance!

By looking at the tutorial code

The GCMC example is also heterograph and it gives how to format nodes with features. The basic idea for node feature is if we donot have node features, we simply treat each node as onehot in a space of number of nodes, so the shape of the W of the first layer of RGCN will be (N(nodes), hidden); if we have some node features, then the shape of the W of the first layer of RGCN can be (feature_sizie, hidden).

1 Like

Hi, thank you for the answer. Now It is very clear about the node features, but still trying to figure out how to incorporate edge properties in a R-GCN model. Could you also give me your opinion on this? Your thought would be very much appreciated!

Hi. Put edge feature into R-GCN can be a little bit complex. You should iterate each edge type, and then use: g.edges[etype].data[‘h’] to assign edge feature to each edge. BTW, we you design passage passing operations, you should take care of each edge feature.