class StochasticTwoLayerRGCN(nn.Module):
def __init__(self, in_feat, hidden_feat, out_feat, rel_names):
super().__init__()
self.conv1 = dglnn.HeteroGraphConv({
rel[1] : dglnn.GraphConv(in_feat[rel[0]], hidden_feat, norm='right')
for rel in rel_names
})
self.conv2 = dglnn.HeteroGraphConv({
rel[1] : dglnn.GraphConv(hidden_feat, out_feat, norm='right')
for rel in rel_names
})
def forward(self, blocks, x):
x = self.conv1(blocks[0], x)
x = self.conv2(blocks[1], x)
return x
in_features = {'user':n_hetero_features, 'item':2*n_hetero_features}
I have a heterogeneous graph that contains two types of nodes and one type of edge. As shown above, ‘user’ has n_hetero_features dimensional features and ‘item’ has 2*n_hetero_features dimensional features. Can you please tell me if the RGCN module I constructed above implements the function of dividing two different types of nodes into two different subgraphs, each containing only one type of node, and then performing separate convolution operations within the same type of node.
By the way, what if my heterogeneous graph is a heterogeneous bipartite graph? That is, there will be no edges between nodes of the same type, at which point what happens when the RGCN module constructed above is applied?
I would be grateful if you could get an answer!