How aggregation functions work for hetero data? #5550
Replies: 1 comment 2 replies
-
Hi, @shahinghasemi According to your code example, let me introduce how the aggregation function (particularly # We can treat a hetero graph as a group of homogenous graphs
# view 1 (man, edge, woman)
encoder1 = GNNEncoder(neurons, aggregator_conv)
# view 2 (woman, edge, man)
encoder2 = GNNEncoder(neurons, aggregator_conv) Then, it performs aggregation separately on different graph views and gets the representation of destination node types: woman_embedding = encoder1(...) # input (man, edge, woman) graph
man_encoder = encoder2(...) # input (woman, edge, man) graph if you got more graph views (relations), your might have different node embeddings derived from different graph views: woman_embedding1 = ...
woman_embedding2 = ... Finally, woman_embedding = aggregator_hetero[woman_embedding1, woman_embedding2, ...]
... Since you got only one relation for a node type, the For more details, you can refer to this paper and the PyG documentation. Hope this helps :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm wondering how aggregation functions work for heterogeneous data. To make it more clear please consider code below:
the output is as below:
For simplicity let's say that all the weight values are just 1s. Would you please elaborate on
man[0]
andwoman[0]
embedding calculation? It's confusing for me that for example howVariance
aggregation function is applied to which features considering the relations in this hetero data.Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions