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!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:30 (21 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We will post here once we make progress. Sorry for the delay.
You need to install PyG master or from nightly.