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

Is there a way to use graph_nets library to create a end-to-end trainable classifying network? #118

Closed pluu2 closed 3 years ago

pluu2 commented 4 years ago

I am trying to use graph_nets to classify data with a graph structure. I used the existing modules.InteractionNetwork to build the graph network. I put the data through the graph network, and I gathered the edge and node tensors and attempted to put those tensors into a fully connected network which ends in softmax layer.

Unfortunately, when I attempt to use tf.gradient_tape and attempt to apply the gradient over both the graph network and the fully connected network trainable_variables, I am unable to. The error I am returned is: "'tuple' object has no attribute '_in_graph_mode' "

Are there implementations using graph_nets to train these kinds of networks end-to-end?

Thanks

alvarosg commented 4 years ago

There is a TF2 example of how to do node and edge classification using a softmax here.

I gathered the edge and node tensors and attempted to put those tensors into a fully connected network which ends in softmax layer.

I am not sure I completely follow what you are trying to achieve (e.g. what your classification problem exactly is). Could you share the code that does this?

alvarosg commented 3 years ago

(closing due to inactivity)