Kind of pooling to use with node features representing longitude/lattitude #169
Replies: 2 comments 16 replies
-
Hi, Depending on how you structured your network (feel free to post a If you do process the features with a GNN, then the overall network will learn to compute features that make sense when summed (or averaged, or maxed) together. It's not a matter of being "better", it's a matter of being informative enough to solve your task. I am not sure I understand how you process your time series, so I'd need more details to give a more precise answer, but the idea is more or less the same: first you run your convolutions, then pool, and finally run your classification/regression. On a more practical note: the choice of global pooling may depend on your task, but sum pooling is usually a safe bet. Cheers |
Beta Was this translation helpful? Give feedback.
-
Hi @danielegrattarola, I got pretty far with adjusting your example dataset generating .py file to my kind of usecase. It is not a regression task, but now it is an toy usecase inspired from the 'multiple parallel series' paragraph from here. The class generates a set of n nodes, gives it x and y locations by giving the networkx graph a layout, calculates the distance between each node as an edge weight, then generates similar time series as from the website example named above. In that example, they create multiple parallel series and want to predict the next value for each series:
So the graph has the adjacency matrix, the xy locations as node features, the time series as data, and the node labels as y are the next values in the time series.
However, I have some trouble in accessing the time series data that I give the MyGraphMaker class by returning:
When I try to print dataset.data, it will give an attribute error saying the MyGraphMaker object has no attribute 'data'. How could I tell the class that I would like to retrieve this data variable for each of the graphs in the class? Similar to doing dataset.n_labels? Kind regards! :) Stefan |
Beta Was this translation helpful? Give feedback.
-
Hi creators of Spektral,
First of all, thank you for creating this amazing package.
I am working on combining graph neural networks with time series data. In here, I have as node features for the graph convolutional layer: longitude and lattitude of each node in the network. As the graph input i have the normalized adjacency matrices. The other inputs are my time series data for each node which go in the cnn.
What would be a correct way to use pooling in this scenario? The decision confuses me since it does not make sense to average, sum or max the node features, since a higher or lower longitude or lattitude is not better than a lower longitude lattitude). Also, the relevance of a node is only made clear after the graph convolutional layers where i append a classical cnn to process the time series data. So using attention layers for pooling makes no sense to me as well, since you need the time series to know which node has some interesting things going on.
Beta Was this translation helpful? Give feedback.
All reactions