{"id":18797616,"url":"https://github.com/lirongwu/rfa-gnn","last_synced_at":"2025-04-13T16:32:11.692Z","repository":{"id":108500763,"uuid":"578873717","full_name":"LirongWu/RFA-GNN","owner":"LirongWu","description":"Code for TNNLS paper \"Beyond Homophily and Homogeneity Assumption: Relation-based Frequency Adaptive Graph Neural Networks\"","archived":false,"fork":false,"pushed_at":"2024-02-27T07:51:36.000Z","size":21,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T07:48:02.012Z","etag":null,"topics":["graph-algorithms","graph-representation-learning","heterogeneous-graph-learning","heterophily-graph","relation-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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-12-16T04:46:04.000Z","updated_at":"2024-11-27T01:23:59.000Z","dependencies_parsed_at":"2023-05-22T12:45:16.871Z","dependency_job_id":null,"html_url":"https://github.com/LirongWu/RFA-GNN","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LirongWu%2FRFA-GNN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LirongWu%2FRFA-GNN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LirongWu%2FRFA-GNN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LirongWu%2FRFA-GNN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LirongWu","download_url":"https://codeload.github.com/LirongWu/RFA-GNN/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248743902,"owners_count":21154765,"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-algorithms","graph-representation-learning","heterogeneous-graph-learning","heterophily-graph","relation-learning"],"created_at":"2024-11-07T22:08:53.965Z","updated_at":"2025-04-13T16:32:11.431Z","avatar_url":"https://github.com/LirongWu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Relation-based Frequency Adaptive Graph Neural Networks (RFA-GNN)\n\n\nThis is a PyTorch implementation of the RFA-GNN, and the code includes the following modules:\n\n* Datasets (Cora, Citeseer, Pubmed, Texas, Cornell, Wisconsin, Film, Chameleon, Squirrel, Syn-Cora,  Syn-Relation, and ZINC)\n\n* Training paradigm for node classification, graph classification, and graph regression tasks on 12 datasets\n\n* Visualization\n\n* Evaluation metrics \n\n  \n\n## Main Requirements\n\n* dgl==0.5.3\n* networkx==2.5\n* numpy==1.19.2\n* matplotlib==3.1.1\n* scikit-learn==0.24.1\n* scipy==1.5.2\n* torch==1.6.0\n\n\n\n## Description\n\n* train.py  \n  * main() -- Train a new model for **node classification** task on the *Cora, Citeseer, Pubmed, Texas, Cornell, Wisconsin, Film, Chameleon, Squirrel, and Syn-Cora* datasets\n  * accuracy() -- Test the learned model for **node classification** task on the *Cora, Citeseer, Pubmed, Texas, Cornell, Wisconsin, Film, Chameleon, Squirrel, and Syn-Cora* datasets\n  * main_synthetic() -- Train a new model for **graph classification** task on the *Syn-Relation* dataset\n  * evaluate_synthetic() -- Test the learned model for **graph classification** task on the *Syn-Relation* dataset\n  * main_zinc() -- Train a new model for **graph regression** task on the *ZINC* datasets\n  * evaluate_zinc() -- Test the learned model for **graph regression** task on the *ZINC* datasets\n* dataset.py  \n  \n  * preprocess_data() -- Load data of selected dataset\n* model_RFAGCN.py  \n  \n  * RFAGNN() -- model and loss\n* utils.py  \n  * evaluate_graph() -- Evaluate relation-learning performance with *the visualization of the learned relation graphs*\n\n\n\n## Running the code\n\n1. Install the required dependency packages\n\n2. We use [DGL](https://www.dgl.ai/) to implement all the GCN models (and their modules) on 12 datasets. The three citation datasets (Cora, Citeseer, and Pubmed) are provided by the [DGL](https://www.dgl.ai/) library; the Syn-relation and  Syn-cora datasets are self-generated by the provided code `dataset.py`; the ZINC dataset and the remainding six heterophily datasets are downloaded from the [Google Drive](https://drive.google.com/file/d/1p3pMblv7eMRLtB4LERHwt8a50VvHp64n/view?usp=sharing).\n\n3. To get the results on a specific *dataset*, run with proper hyperparameters\n\n  ```\npython train.py --dataset data_name\n  ```\n\nwhere the *data_name* is one of the 12 datasets (Cora, Citeseer, Pubmed, Texas, Cornell, Wisconsin, Film, Chameleon, Squirrel, Syn-relation,  Syn-cora, and Zinc). The model as well as the training log will be saved to the corresponding dir in **./log** for evaluation.\n\n4. The evaluation the performance of three-level disentanglement performance, run\n\n  ```\npython utils.py\n  ```\n\n\n\n## Citation\n\nIf you find this project useful for your research, please use the following BibTeX entry.\n\n```\n@article{wu2023beyond,\n  title={Beyond homophily and homogeneity assumption: Relation-based frequency adaptive graph neural networks},\n  author={Wu, Lirong and Lin, Haitao and Hu, Bozhen and Tan, Cheng and Gao, Zhangyang and Liu, Zicheng and Li, Stan Z},\n  journal={IEEE Transactions on Neural Networks and Learning Systems},\n  year={2023},\n  publisher={IEEE}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flirongwu%2Frfa-gnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flirongwu%2Frfa-gnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flirongwu%2Frfa-gnn/lists"}