-
If I have a heterogeneous graph in which some nodes possess feature arrays while others do not, as illustrated in the following graph structure:
However, when I input this graph into the GNN, it fails to account for the node types "word," "lemma," and "root." I understand that these node types were not explicitly defined. My question is as follows: Can node types be inferred from the edge lists, or is there a technique to incorporate the node types without necessarily providing their feature arrays? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You would still need to define these node types. Correctly, e.g., via data["tweet"].num_nodes = ... Afterwards, your GNN expects that there exists node features for these types. You can either add a dummy feature vector, e.g., |
Beta Was this translation helpful? Give feedback.
You would still need to define these node types. Correctly, e.g., via
Afterwards, your GNN expects that there exists node features for these types. You can either add a dummy feature vector, e.g.,
torch.ones(num_nodes, 1)
to these node types, or learn a feature representation for them viatorch.nn.Embedding
.