In my graph classification application, I want to concatenate the embedded vectors of nodes in the readout function, instead of averaging them by dgl.mean_nodes(). What should I do?
May I know why do you want to concatenate the node features for graph representations? Typically this is not encouraged for two reasons:
- The graphs can have different number of nodes and we need to perform additional zero padding.
- The resulted graph representations will highly depend on the index of nodes while typically we consider two graphs to be a same graph if we can get one graph by relabeling the nodes in the other graph.
Thank you very much for your timely reply.
I think in some cases, averaging the embedded vectors of all nodes will lose some information, so concatenating vectors together may retain more information. Based on your explanation, I understand that doing so may not achieve my expected purpose.
Thanks again for your reply.