microsoft / gated-graph-neural-network-samples

Sample Code for Gated Graph Neural Networks
MIT License
1.03k stars 264 forks source link

Explaining data in .json files #24

Closed a7med-95 closed 4 years ago

a7med-95 commented 4 years ago

The following are data that follow this model downloaded by me: Here is a json object from valid.json { "targets": [ [ -0.3917742606773421 ] ], "graph": [ [ 0, 2, 1 ], [ 0, 1, 2 ], [ 0, 1, 3 ] ], "node_features": [ [ 0, 1, 0, 0, 0 ], [ 0, 0, 0, 1, 0 ], [ 1, 0, 0, 0, 0 ], [ 1, 0, 0, 0, 0 ] ] }

I wonder how the graph data (edges) are presented.

In the example above:

mmjb commented 4 years ago

A triple (u, e, v) represents an edge from u to v of type e. For an example of turning this information into a adjacency matrices (one per edge type), see this code: https://github.com/microsoft/gated-graph-neural-network-samples/blob/master/chem_tensorflow_dense.py#L30

a7med-95 commented 4 years ago

Thanks @mmjb , that's make sense now. I see that there are up to 4 types of edges (in case of dense). Where can i find more information about these types ?