-
My graph consists of nodes with some features each. |
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
Feb 17, 2021
Replies: 1 comment 5 replies
-
I suggest to use dataset def my_transform(data):
mean = data.x.mean(dim=0, keepdim=True)
data.x = torch.cat([x, mean], dim=0)
return data
Dataset(..., transform=my_transform) |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
tferber
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I suggest to use dataset
transform
s for that, which allows to just add the global node feature to each graph in separation: