Skip to content
Discussion options

You must be logged in to vote

Yes, most if not all GNN layers proposed in research do not update edge features. One exception that comes to my mind is the MetaLayer in PyG. Nonetheless, it should be straightforward to allow something like this in PyG via the edge_updater functionality:

class MyEdgeConv(MessagePassing):
    def __init__(self):
        super().__init__(aggr='add')

    def forward(self, x: Tensor, edge_index: Adj) -> Tensor:
        edge_attr = self.edge_updater(edge_index, x=x)

        out = self.propagate(edge_index, edge_attr=edge_attr,
                              size=(x.size(0), x.size(0)))

        return out, edge_attr

    def edge_update(self, x_j: Tensor, x_i: Tensor) -> Tensor:
        return

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@alzaia
Comment options

@rusty1s
Comment options

@alzaia
Comment options

@rusty1s
Comment options

Answer selected by alzaia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants