Replies: 1 comment
-
That's an interesting issue. I think for batching, we generally expect that types and attributes are consistent across graphs. We could potentially allow batching of graphs in which node/edge types do not need to be consistent, but this also creates problems on the model side, e.g., for some mini-batches certain node/edge types may be present while for others they might not. I agree that adding "virtual" nodes is a dirty and ugly way to resolve this, but I don't think it effects efficiency at all if you initialize them as empty tensors, e.g.: for node_type in union_of_node_types:
data[node_type].x = torch.tensor([0, num_features_for_node_type], dtype=torch.float)
for edge_type in union_of_edge_types:
data[edge_type.edge_index = torch.tensor([2, 0], dtype=torch.long) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For example, given 100 heterogeneous graphs, some of them have the edge type "author (works with) author" while such a edge type does not exist in other graphs in the 100 ones.
One idea is to generate "virtual nodes and edges" to make up non-existing edge types (node types) and all graphs have the same metadata, which is actually the union of all metadata in different graphs.
But this one may be too dirty and harms efficiency. Any better solution?
Beta Was this translation helpful? Give feedback.
All reactions