Hello,
I am trying to batch a set of heterographs to improve the training efficiency for a Heterogeneous GCN. I am using dglnn.GraphConv to define the relations within the each HeteroGraphConv layer. It works fine for inferring and training with a single graph with a feature dictionary for the nodes at a time (no edge features).
However, I have trouble understanding the format of the feature dictionary for the batched graph. As the batched graph comprise of all the nodes of the disjoint graphs and is also a heterograph, I tried concatenating the features for each node type into a single tensor within the feature dictionary; but it throws this error:
RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x220 and 22x32)
Note that each disjoint graph has 22 nodes, batch size is 10 and thus the batched graph has 220 nodes (in this case all the graphs have same number of nodes, but it can change).
Is there an alternative way to define the feature dictionary for the batched heterogeneous graph? I tried Deep Graph Library, and dgl.batch — DGL 0.6.1 documentation but they don’t explicitly state about defining the batched heterograph feature dictionary.
Thanks in advance!