Hello,
I’m new to DGL and deep learning on graphs in general. Reading through the API, I’m wondering if it’s possible to achieve this sort of functionality: Say node 0 is the source of nodes 1 and 2, and no other edges exist. If I do something like:
def my_msg(edges):
return {'msg' : 2*edges.src['h']}
def my_reduce(nodes):
return {'h' : torch.sum(nodes.mailbox['msg'], dim=1)}
G.send(G.edges(), my_msg)
G.recv(G.nodes(), my_reduce)
Then nodes 1 and 2 will both end up with twice the value of node 0’s ‘h’ property.
Is there a way to control the messaging behavior so that, say, node 0 sends double its value to node 1, but triple its value to node 3? There doesn’t seem to be any way to pack the source label info into dictionary that’s returned from my_msg
.
If this isn’t possble, maybe I am missing some of the main motivations behind these types of frameworks? Please enlighten me in either case.