Skip to content
Discussion options

You must be logged in to vote

Mh, tricky problem. Can the subgraph structures already be used for link prediction, or do you just want to use them as initial feature representations and then use a second GNN for link prediction?

What I imagine you could to is to have two datasets: one that models your initial graph, and then a second dataset which can be used to index the subgraph structures for each sampled node in the initial graph. That would look something like:

data.n_id = torch.arange(data.num_nodes)
loader = LinkNeighborLoader(data, ...)
for batch in loader:
    # Get the subgraphs for each sampled node:
    data_list = subgraph_dataset[batch.n_id]
    subgraph_batch = Batch.from_data_list(data_list)
    x = model

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GianlucaDeStefano
Comment options

Answer selected by GianlucaDeStefano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants