Referencing the original node embeddings inside Aggregation
in GCNConv
#5959
MichaelHopwood
started this conversation in
General
Replies: 1 comment
-
It's not straightforward to do so in PyG, but you can achieve this with some necessary modifications: from torch_geometric.nn import GCNConv
from torch_geometric.nn.aggr import MultiAggregation
class MyAggr(MultiAggregation):
def combine(self, inputs):
# inputs hold the outputs aggregated by `mean` and `std`
return inputs
class MyConv(GCNConv):
def update(self, inputs, x):
mean, std = inputs
return (x - mean) / std
aggr = MyAggr([MeanAggregation(), StdAggregation()])
MyConv(..., aggr=aggr) |
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.
-
mu
andstd
aggregations have been set up in this package but I was hoping to get az=(x-mu)/std
where x is the embeddings of the current node.How do we find
x
though? I see that anindex
is passed in to show which representations should be aggregated to which node. In other words, how can we reference the values of the seed nodes?Here is my
requirements.txt
:Beta Was this translation helpful? Give feedback.
All reactions