<p>Not sure whether the question still needs to be answered, but I guess it boils down to how to implement models like <a href="https://arxiv.org/abs/1703.06103" rel="nofollow noreferrer">R-GCN</a> or <a href="https://arxiv.org/abs/2003.01332" rel="nofollow noreferrer">HGT</a> with DGL. Some of these layers come build-in with DGL <a href="https://docs.dgl.ai/api/python/nn.html" rel="nofollow noreferrer">here</a>. But it is also easy to implement your own computations. The following explanation only makes sense if you know the basic computational process of DGL during a forward pass through a graph layer (message, reduce, apply_node), if not DGL has good tutorials on that as well. To extend the usual graph computation to for example edges of different types you need to create a heterogenous Graph object and call <code>multi_update_all</code> on that graph object. You can pass a dictionary to that function which specifies the computation per edge type.</p>
Using edge features for GCN in DGL
<p>I'm trying to implement a graph convolutional network (GCN) in the Deep Graph Learning (DGL) package for Python. In many papers, edges have discrete features, and each possible value is associated with a different weight matrix or set of weight matrices. An example would be <a href="https://pubs.acs.org/doi/full/10.1021/acscentsci.8b00507" rel="nofollow noreferrer">here</a>. Is anyone familiar with how to implement a model like this in DGL? The DGL team's example of GCNs for <a href="https://docs.dgl.ai/tutorials/basics/4_batch.html" rel="nofollow noreferrer">graph classification</a>, as does <a href="https://iwatobipen.wordpress.com/2019/02/01/try-gcn-qspr-with-pytorch-based-graph-library-rdkit-pytorch-dgl/" rel="nofollow noreferrer">another example</a> I found online.</p>