google-deepmind / graph_nets

Build Graph Nets in Tensorflow
https://arxiv.org/abs/1806.01261
Apache License 2.0
5.34k stars 783 forks source link

how to build an heterogeneous graph network? #140

Closed zhou-frank closed 3 years ago

zhou-frank commented 3 years ago

Hi

Recently, I read the paper "LEARNING MESH-BASED SIMULATION WITH GRAPH NETWORKS".In this paper, the author use two type of edge to pass message , which contain mesh-space and world-space.

How to use graph_nets lib to build this heterogeneous graph network above?

Many thanks for helping me.

alvarosg commented 3 years ago

Thanks for your message. The graph nets library does not currently support heterogeneous graphs in a single GraphsTuple.

The simple option would be to keep two GraphsTuples one with each of the types of edges, and with the same nodes. And then use the blocks.broadcasters/aggregator ops to build a model similar to the existing blocks.NodeUpdate and blocks.EdgeUpdate` that operates on both graphs in parallel.

Some options:

zhou-frank commented 3 years ago

@alvarosg thanks for your help.I will try to implement your advise approach.

Besides, may i ask you a question? When will you publish the code of the paper?

alvarosg commented 3 years ago

Code is now available here https://github.com/deepmind/deepmind-research/tree/master/meshgraphnets :)