pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.25k stars 3.65k forks source link

Metalayer functionality #1118

Closed thinkingparticle closed 4 years ago

thinkingparticle commented 4 years ago

In the original paper ( Relational inductive biases, deep learning, and graph networks ) authors explain Attributes as "properties that can be encoded as a vector, set, or even another graph" .

With the Metalayer implementation in pytorch_geometric, how can I define my model such that my nodes' attributes are a graph themselves?

64543763-06ac5800-d33b-11e9-8774-f8e219e78488

Can you provide an example implementation of attributes of nodes/edges of a graph, where each attribute is a graph?

rusty1s commented 4 years ago

The MetaLayer in PyG is kind of restrictive in that sense that it is limited to node, edge, and global vectors. If you want more specialized modeling, it should be no problem to create something like this by building upon the MessagePassing interface. There is no limitation to, e.g., integrate another graph in the computation scheme. However, it is hard for me to imagine a use-case for this, so I cannot give you a concrete example at the moment.