question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Link-level `NeighborLoader`

See original GitHub issue

🚀 The feature, motivation and pitch

Currently, NeighborLoader is designed to be applied in node-level tasks and there exists no option for mini-batching in link-level tasks.

To achieve this, users currently rely on a simple but hacky workaround, first utilized in ogbl-citation2 in this example.

The idea is straightforward and simple: For input_nodes, we pass in both the source and destination nodes for every link we want to do link prediction on (both positive and negative):

loader = NeighborLoader(data, input_nodes=edge_label_index.view(-1), ...)

Nonetheless, PyG should provide a dedicated class to perform mini-batch on link-level tasks, re-using functionality from NeighborLoader under-the-hood. An API could look like:

class LinkLevelNeighborLoader(
    data,
     input_edges=...
     input_edge_labels=...
     with_negative_sampling=True,
     **kwargs,
)

NOTE: This workaround currently only works for homogenous graphs!

@RexYing @JiaxuanYou

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:30 (21 by maintainers)

github_iconTop GitHub Comments

2reactions
rusty1scommented, Mar 4, 2022

We will post here once we make progress. Sorry for the delay.

1reaction
rusty1scommented, Jul 18, 2022

You need to install PyG master or from nightly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

torch_geometric.data — pytorch_geometric documentation
A data object describing a homogeneous graph. The data object can hold node-level, link-level and graph-level attributes. In general, Data tries to mimic...
Read more >
GitHub - pyg-team/pytorch_geometric: Graph Neural Network ...
NeighborSampler and NeighborLoader from Hamilton et al. ... PyG 2.1.0: Principled aggregations, link-level and temporal samplers, data pipe support, .
Read more >
文件 · super_gat · mirrors / rusty1s / pytorch_geometric · GitCode
NeighborSampler and NeighborLoader from Hamilton et al. ... PyG 2.1.0: Principled aggregations, link-level and temporal samplers, data pipe support, .
Read more >
Link Property Prediction - Open Graph Benchmark
Scale, Name, Package, #Nodes, #Edges*, Split Type, Task Type, Metric. Medium, ogbl-ppa, >=1.1.1, 576,289, 30,326,273, Throughput, Link prediction, Hits@100.
Read more >
发布 · mirrors / rusty1s / pytorch_geometric - GitCode
Link-level Neighbor Loader ... Both NeighborLoader and LinkNeighborLoader now support temporal sampling via the time_attr argument (#4025, #4877, #4908, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found