tensorflow / gnn

TensorFlow GNN is a library to build Graph Neural Networks on the TensorFlow platform.
Apache License 2.0
1.34k stars 171 forks source link

How to construct samples that contain both graphs and other features? For example, (graph, feature_1, feature_2, ...). #806

Closed OysterQAQ closed 1 month ago

arnoegw commented 2 months ago

The input to a Keras Model can be any nest of tensors, including the kind of tuple you sketched.

For deserialization from tf.train.Example, esp. in the presence of more than one GraphTensor, the prefix= argument of tfgnn.parse_example() might come in handy.

Alternatively, if each example has one graph plus some freestanding features, consider packing the freestanding features into the Graph.context, see the Data Preparation and Sampling guide.