Heterogeneous graph learning with potentially empty node types and edge types #4143
-
Hi there, I was wondering if there is an expected way of using HeteroData with graphs that contain a node type, but no actual nodes present of that node type. The use case here is for multiple heterogeneous graphs which may contain subsets of all the possible node types, e.g. g1 has nodes with node type a, b and c while g2 only has nodes of node type a and b. Likewise for edges, g2 will not have any edges to nodes of type c. These two graphs should both be valid inputs for a single heterogeneous GNN. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Yes, you might need a workaround to let this use-case work in a mini-batch scenario. It was also reported here: #3984. One simple workaround is to just set the feature matrix to be empty: data['node_type].x = torch.empty(0, num_features) |
Beta Was this translation helpful? Give feedback.
Yes, you might need a workaround to let this use-case work in a mini-batch scenario. It was also reported here: #3984.
One simple workaround is to just set the feature matrix to be empty: