{"id":20515446,"url":"https://github.com/snap-research/linkless-link-prediction","last_synced_at":"2025-04-14T00:23:43.221Z","repository":{"id":194422570,"uuid":"545195107","full_name":"snap-research/linkless-link-prediction","owner":"snap-research","description":"[ICML 2023] Linkless Link Prediction via Relational Distillation","archived":false,"fork":false,"pushed_at":"2023-10-04T18:01:21.000Z","size":188,"stargazers_count":19,"open_issues_count":1,"forks_count":7,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-27T14:46:40.674Z","etag":null,"topics":["deep-learning","distillation","efficient-inference","gnn","graph-neural-networks","knowledge-distillation","link-prediction","scalability"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snap-research.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-04T00:17:09.000Z","updated_at":"2024-12-30T14:50:12.000Z","dependencies_parsed_at":"2023-09-13T08:15:24.557Z","dependency_job_id":"83238ccb-b216-493f-b0fd-7b39f632b9f5","html_url":"https://github.com/snap-research/linkless-link-prediction","commit_stats":null,"previous_names":["snap-research/linkless-link-prediction"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-research%2Flinkless-link-prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-research%2Flinkless-link-prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-research%2Flinkless-link-prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-research%2Flinkless-link-prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snap-research","download_url":"https://codeload.github.com/snap-research/linkless-link-prediction/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248800080,"owners_count":21163404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","distillation","efficient-inference","gnn","graph-neural-networks","knowledge-distillation","link-prediction","scalability"],"created_at":"2024-11-15T21:21:47.165Z","updated_at":"2025-04-14T00:23:43.177Z","avatar_url":"https://github.com/snap-research.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linkless Link Prediction via Relational Distillation\n\n## Introduction\nThis repository contains the source code for the paper: [Linkless Link Prediction via Relational Distillation](https://arxiv.org/pdf/2210.05801.pdf) \n\u003cimg width=\"1209\" alt=\"image\" src=\"https://user-images.githubusercontent.com/69767476/193711518-fdc8c163-7bbc-4118-ad55-75835954d2c7.png\"\u003e\n\n## Requirements\nPlease run the following code to install all the requirements:\n```\npip install -r requirements.txt\n```\n\n## Usage\n### Transductive Setting \n- **Teacher GNN training.** You can change \"sage\" to \"mlp\" to obtain supervised training results with MLP. \n```\npython train_teacher_gnn.py --datasets=cora --encoder=sage --transductive=transductive\n```\nTo reproduce the supervised results shown in Table 2, you can just simply run the following command. The results will be shown in results/.\n```\ncd scripts/\nbash supervised_transductive.sh\n```\n- **Student MLP training.** LLP_D and LLP_R indicate the weights for the distribution-based and rank-based matching KD, respectively.\n```\npython main.py --datasets=cora --LLP_D=1 --LLP_R=1 --True_label=1 --transductive=transductive\n```\nTo reproduce the results shown in Table 2, please run the following command:\n```\ncd scripts/\nbash KD_transductive.sh\n```\n### Production Setting\n- **Pre-process dataset**\nIn this work, we design a new production setting to resemble the real-world link prediction scenario. This setting mimics practical link prediction use cases. Under the production setting, the newly occurred nodes and edges that can not be seen during the training stage would appear in the graph at inference time. For more details, please refer to our paper Appendix C.2. If you want to apply this setting on our own datasets or split the datsets by your self, please change the dataset name (\"dataset\") in Line 194 in generate_production_split.py file and run the following command:\n```\npython generate_production_split.py\n```\n- **Teacher GNN training.** Note: changing \"sage\" to \"mlp\" can reproduce the supervised training results with MLP.\n```\npython train_teacher_gnn.py --datasets=cora --encoder=sage --transductive=production\n```\nTo reproduce the supervised results shown in Table 3, you can just simply run the following command. The results will be shown in results/.\n```\ncd scripts/\nbash supervised_production.sh\n```\n- **Student MLP training.** LLP_D and LLP_R indicate the weights for the distribution-based and rank-based matching KD, respectively.\n```\npython main.py --datasets=cora --LLP_D=1 --LLP_R=1 --True_label=1 --transductive=production\n```\nTo reproduce the results shown in Table 3, please run the following command:\n```\ncd scripts/\nbash KD_production.sh\n```\n### Reproducing Paper Results\nIn our experiments, we found that the link prediction performance (when evaluated with Hits@K) of models can greatly vary even when run with the same hyperparameters. Besides, the performance of our method is sensitive to the teacher GNN. Therefore, as mentioned in our paper, we run a hyperparameter sweep for each setting and report the results from the best-performing model (as measured by validation Hits@K).\n\nWe conducted a random search across the hyperparameters with [Weights \u0026 Biases](https://wandb.ai/home). The sweep configuration files can be found [here](./configurations/).\n\n## Reference\nIf you find our work useful, please cite the following:\n```bibtex\n@inproceedings{guo2023linkless,\n  title={Linkless link prediction via relational distillation},\n  author={Guo, Zhichun and Shiao, William and Zhang, Shichang and Liu, Yozen and Chawla, Nitesh V and Shah, Neil and Zhao, Tong},\n  booktitle={International Conference on Machine Learning},\n  pages={12012--12033},\n  year={2023},\n  organization={PMLR}\n}\n```\n\n## Contact\nPlease contact zguo5@nd.edu if you have any questions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnap-research%2Flinkless-link-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnap-research%2Flinkless-link-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnap-research%2Flinkless-link-prediction/lists"}