I was hoping to get some feedback on a graph neural network I have designed. I've been doing this by myself, so this is a sanity check to make sure I have understood this correctly.

I have a selection of small graphs, each node has 4 features. I want to classify each graph as belonging to category A or B.

My network structure is:

graphConvLayer1() – this takes 4 features as input and returns 3

graphConvLayer2() – this takes 3 features as input and returns 1

These layers should aggregate each nodes features together with their neighbours

This should return an object that is N*1 (where N is the original number of nodes). This can then be fed into a set of linear layers, with dropouts.

This setup gets decent classification ability, but this architecture seems to go against some resources I've found and led me to be kinda unsure what to do (https://medium.com/@sunitachoudhary103/how-to-deal-the-graphs-data-in-deep-learning-with-graph-convolutional-networks-gcn-39f69db072ee). I feel like I have followed tutorials I've seen on the subject, but the previous link implies there should be pooling layers between the graph layers, and that the number of nodes should be changing (which isn't happening for me)

How should I adapt my network?


If all of your input graphs are the same size, then your approach works fine. Otherwise, the size of the linear layer would need to change based on the size of the input graph. Pooling is one way of getting around this, by transforming the representation of N nodes into a form which doesn't depend on N, and thus can be plugged into a linear layer.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.