2
$\begingroup$

I checked out applications of GraphSAGE and it seems like its primarily used for single graph datasets. For example - Cora dataset - Its one big graph with 2708 nodes and 5429 edges. The model can learn the node representation of this big graph and it can be later used for downstream tasks like node classification, link prediction.

I have a dataset with hundreds of graphs that are relatively small (about 15 nodes and 20 edges on avg per graph). Each graph represents a separate datapoint i.e, there is no relation between these graphs. It is similar to datasets like MUTAG, PROTEIN datasets . My question is if GraphSAGE is suitable for this kind of data ? Can it be used to learn node representation and be used for downstream tasks like node/graph/link classification?

I am following this stellargraph example - stellargraph_graphsage It uses a sampler to perform random walks and solve a classification task. However, this sampler intakes only one Graph as input (big Cora graph). I am confused about how to use a dataset with multiple graphs here.

unsupervised_samples = UnsupervisedSampler(
    G, nodes=nodes, length=length, number_of_walks=number_of_walks
)
$\endgroup$

1 Answer 1

3
$\begingroup$

My question is if GraphSAGE is suitable for this kind of data?

To my knowledge, GraphSAGE is designed for very large graphs with highly connected nodes (like social networks). The neighborhood sampling mitigates oversmoothing problems that occur when aggregating large neighborhoods. I guess that other architectures are better suited, but it's always worth trying it out with your dataset.

Can it be used to learn node representation and be used for downstream tasks like node/graph/link classification?

Yes, GraphSAGE produces node embeddings for every node that can be used for a classification or a regression task.

However, this sampler intakes only one Graph as input (big Cora graph). I am confused about how to use a dataset with multiple graphs here.

Most graph libraries work like that. The models/functions only accept a single graph, if you want to input multiple graphs at once, you can take a look at graph batching. How it works is that you combine your $n$ separate graphs into a single large graph (with disjoint subgraphs) because GNNs work on neighborhoods the individual graphs will not affect each other. Here this principle is described.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .