-
I am currently modelling a graph that has Different type of edges, let's say (X1) and (X2) and it can also have a w RGCNConv gives the ability to have the first part which is having a (W) matrix for each relation type, however i don't want to treat all edges equally. how would you start implementing this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If I understand you correctly, you are searching for a way to apply def forward(self, x, edge_index, edge_weight, edge_type):
out = 0
for i in range(num_edge_types):
mask = edge_type == i
out += self.propagate(edge_index[:, mask], edge_type=i, edge_weight=edge_weight[mask])
return out
def message(self, x_j, edge_weight, edge_type):
return edge_weight * x_j @ self.weight[edge_type] |
Beta Was this translation helpful? Give feedback.
If I understand you correctly, you are searching for a way to apply
RGCNConv
on weighted graphs? In that case, you can extendRGCNConv
and add anedge_weight
to its argument which is then used inmessage
. Pseudo-code: