Tensorflow GNN Questions

Is there any actual official documentation for this? I’m struggling to find anything with a Google search.

As a specific question, I’d like to understand how to use GraphTensor.from_pieces to create a graph tensor for a simple graph I have described presently by python dictionaries: nodes is {node_id: node_features} and edges is {(node_from,node_to):edge_features}.

I used syntax like this:

GraphTensor.from_pieces(node_sets={‘node’: NodeSet.from_fields(sizes=[N], features={‘node_feature’:node_features})}, edge_sets={‘edge’: EdgeSet.from_fields(sizes=[N2], features={‘edge_feature’:edge_features}, adjacency=Adjacency.from_indices(source=(‘node’:fr), target=‘node’:to)))})

This works so long as my node id’s are up counts starting at zero, but I’m confused how to relate the nodes to the edges when the node_ids are arbitrary integers. Is there a way to provide a specific label to each node in the node_sets description?

1 Like