GraphSAGE with edge features? #4737
Answered
by
rusty1s
j-adamczyk
asked this question in
Q&A
-
I am trying to implement GraphSAGE variant using edge features. I am using OGB implementation of GCN and GIN with edge features as a starting point: https://github.com/snap-stanford/ogb/blob/master/examples/graphproppred/mol/conv.py. In PyG
So I guess I have to change 2 things:
I tried, basing on #3544 (reply in thread):
But this does not work, as there are no |
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
May 30, 2022
Replies: 1 comment 1 reply
-
def forward(self, x, edge_index, edge_attr):
out = self.propagate(edge_index, x=x, edge_attr=edge_attr)
return self.lin_r(x) + out
def message(self, x_j, edge_attr):
return self.lin_l(x_j) + self.bond_encoder(edge_attr) should do the trick. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
j-adamczyk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
should do the trick.