{"id":18797620,"url":"https://github.com/lirongwu/l2a","last_synced_at":"2025-09-02T09:31:51.325Z","repository":{"id":204094475,"uuid":"650491113","full_name":"LirongWu/L2A","owner":"LirongWu","description":"Code for ECML-PKDD 2023 paper \"Learning to Augment Graph Structure for both Homophily and Heterophily Graphs\"","archived":false,"fork":false,"pushed_at":"2024-02-27T07:57:07.000Z","size":3207,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-07T22:08:52.351Z","etag":null,"topics":["graph-augmentation","graph-self-supervised-learning","heterophily-graph","node-classification","semi-supervised-learning"],"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/LirongWu.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}},"created_at":"2023-06-07T07:22:00.000Z","updated_at":"2024-10-31T02:57:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8cd4c5a-2b8b-4576-9246-c3578600278e","html_url":"https://github.com/LirongWu/L2A","commit_stats":null,"previous_names":["lirongwu/l2a"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LirongWu%2FL2A","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LirongWu%2FL2A/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LirongWu%2FL2A/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LirongWu%2FL2A/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LirongWu","download_url":"https://codeload.github.com/LirongWu/L2A/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231768619,"owners_count":18423794,"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":["graph-augmentation","graph-self-supervised-learning","heterophily-graph","node-classification","semi-supervised-learning"],"created_at":"2024-11-07T22:08:56.014Z","updated_at":"2024-12-29T18:14:11.880Z","avatar_url":"https://github.com/LirongWu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learning to Augment (L2A)\n\n\nThis is a PyTorch implementation of the Learning to Augment (L2A), and the code includes the following modules:\n\n* Dataset Loader (Cora, Citeseer, BlagCatalog, Texas, Cornell, Wisconsin, Actor, and Syn-Cora)\n\n* Various Architectures (GCN, SAGE, GAT, and GNN Classifier used in this paper)\n\n* Training paradigm pre-training and fine-tuning on 8 datasets\n\n* Visualization and evaluation metrics \n\n  \n\n## Main Requirements\n\n* networkx==2.5\n* numpy==1.19.2\n* scipy==1.5.2\n* torch==1.6.0\n* pyro_ppl==1.3.0\n\n\n\n## Description\n\n* main.py  \n  * pretrain_EdgePredictor() -- Pretrain Graph Augmentor\n  * pretrain_Classifier() -- Pretrain GNN Classifier\n  * main() -- Train the model for node classification task on the *Cora, Citeseer, BlagCatalog, Texas, Cornell, Wisconsin, Actor, and Syn-Cora* datasets\n* model.py  \n  \n  * GCNLayer() -- GCN Layer\n  * SageConv() -- SAGE Layer\n  * GATLayer() -- GAT Layer\n  * EdgePredictor() -- Learn parameterized augmentation distribution\n  * EdgeSampler() -- Perform gumbel-softmax sampling\n  * EdgeLearning() -- Learn weighted graph\n  * Classifier() -- Classify nodes based on the learned weighted graph\n* graphSSL.py  \n  * DistanceCluster() -- Perform self-supervised Global-Path Prediction\n  * ContextLabel() -- Perform self-supervised Local Label Distribution Preservation\n* dataset.py  \n\n  * load_data() -- Load synthetic and real-world datasets\n* utils.py  \n  * evaluation() -- Calculate classification accuracy\n\n\n\n## Running the code\n\n1. Install the required dependency packages\n\n3. To get the results on a specific *dataset* with a specific *GNN architecture*, please run with proper hyperparameters:\n\n  ```\npython main.py --dataset data_name --model architecture\n  ```\n\nwhere the *data_name* is one of the 8 datasets (Cora, Citeseer, BlagCatalog, Texas, Cornell, Wisconsin, Actor, and Syn-Cora) and *architecture* is one of the 4 GNN architectures (GCN, SAGE, GAT, and GNN Classifier used in this paper). Use *GCN* on the *Cora* dataset an example: \n\n```\npython main.py --dataset cora --model GCN\n```\n\n## Citation\n\nIf you are interested in our repository and our paper, please cite the following paper:\n\n```\n@inproceedings{wu2023learning,\n  title={Learning to Augment Graph Structure for both Homophily and Heterophily Graphs},\n  author={Wu, Lirong and Tan, Cheng and Liu, Zihan and Gao, Zhangyang and Lin, Haitao and Li, Stan Z},\n  booktitle={Joint European Conference on Machine Learning and Knowledge Discovery in Databases},\n  pages={3--18},\n  year={2023},\n  organization={Springer}\n}\n```\n\n## Acknowledgement\n\nThis project borrows the architecture design and part of the code from [GAUG](https://github.com/zhao-tong/GAug).\n\n\n\n## License\n\nLearning to Augment (L2A) is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flirongwu%2Fl2a","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flirongwu%2Fl2a","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flirongwu%2Fl2a/lists"}