What is the message for a node with no connections? #4796
-
Suppose we have a node with no connections and our GNN uses Message Passing Layers. If we consider the general case outlined in the documentation, a Message Passing layer calculates messages by applying some function (typically MLP for instance) to the node features for nodes |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you have no edges, then the output of message will be a tensor of shape |
Beta Was this translation helpful? Give feedback.
If you have no edges, then the output of message will be a tensor of shape
[0, num_features]
. After aggregation, you will obtain an zero-initialized tensor of shape[num_nodes, num_features]
. As such, most implementations either add a self-loop to the graph or apply a simple skip-connection:out = self.propagate(...) + self.lin(x)