Category: B2; Team name: DLLB; Dataset: PPI #234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Co-authored-by: luka-benic [email protected]
Co-authored-by: dleko11 [email protected]
Checklist
Description
This PR extends TopoBench to support edge-level link prediction on both transductive and inductive graph datasets, and adds a tutorial notebook that illustrates how to use the new functionality.
Concretely, the PR introduces:
LinkPredictionReadOut) for link prediction on top of existing GNN backbones (GCN, GAT).Key Changes (Code)
Edge-level splitting
load_edge_transductive_splitsfor single-graph / transductive datasets (e.g. Cora).load_edge_inductive_splitsfor multi-graph / inductive datasets (e.g. MUTAG, PPI).DataloadDatasetobjects with:edge_label_index,edge_label(positive and negative candidate edges),Dynamic negative sampling
NegativeSamplingTransformintopobench.transforms.data_manipulations:edge_label_index,torch_geometric.utils.negative_sampling,edge_label_index/edge_labeleach epoch according toneg_pos_ratioandneg_sampling_method.Edge-level readout
LinkPredictionReadOutintopobench.nn.readouts:x_0from the backbone,PPI dataset support
torch_geometric.datasets.PPI) that:split_idxmapping,Configuration-level support
task_level: edgeandnum_classes: 2for link prediction.split_paramsfor link prediction:learning_setting(transductive / inductive),val_prop,test_prop,train_prop,is_undirected,neg_pos_ratio(dynamic train negatives),neg_sampling_ratio(static val/test negatives),neg_sampling_method.These changes plug into the existing TopoBench training pipeline without altering the high-level interface (Hydra configs +
run.yaml).Tutorial (Usage Example)
To illustrate the new link prediction support, this PR also adds:
tutorials/tutorial_link_prediction.ipynbThe notebook demonstrates:
LinkPredictionReadOutinteract in practice.The tutorial is an example user guide for the new functionality; all core logic lives in the library code.
Issue
Additional context