Dynamic (?) graph supporting ??
See original GitHub issueHi, I’m a big fan of DGL
and always use it for my GNN projects.
I wonder what will be a friendly DGL practice for handling dynamic (?) graphs. It might be good to start with my own definition of a dynamic graph. Hereby, I mean dynamic graph is the graph whose edge connectivity can differ based on the node features.
Such a concept of the graph can be found quite frequently while building models for solving PDEs or simulating physics simulators. One particular case is Learning to Simulate Complex Physics with Graph Networks
, where the graphs are required to be constructed when two particles (nodes) are close to each other.
I realized that, as far as I know, in DGL it will not be easy to implement the edges which are added/deleted based on the node features. So, what will be the most DGL way to implement the idea in this kind of scenario? I guess we can confront quite a similar issue when we handle the set data also.
My hack for implementing such graph computation was to construct a complete graph and mask the messages depending on the node features, which is not computationally efficient.
[1] Learning to Simulate Complex Physics with Graph Networks - http://proceedings.mlr.press/v119/sanchez-gonzalez20a/sanchez-gonzalez20a.pdf
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:13 (3 by maintainers)
I see. I would rather do something like:
This should be more efficient than the one above since
cdist
should be more efficient thanapply_edges
due to dense computation, andnonzero()
is also more efficient thanremove_edges
because the latter are hashtable lookups.Thanks for helping me out! This discussion was a great chance to better understand DGL ops.
Since now this thread is considered to be “feature request”. It might be even better to consider the option
ignore_self
for ignoring particle itself.I believe such feature can be done like above.