{"id":20216087,"url":"https://github.com/thudm/graphmae","last_synced_at":"2025-04-05T13:01:50.687Z","repository":{"id":37663015,"uuid":"494672550","full_name":"THUDM/GraphMAE","owner":"THUDM","description":"GraphMAE: Self-Supervised Masked Graph Autoencoders in KDD'22","archived":false,"fork":false,"pushed_at":"2023-04-12T11:15:23.000Z","size":7567,"stargazers_count":503,"open_issues_count":11,"forks_count":77,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-29T12:02:44.403Z","etag":null,"topics":["deep-learning","graph-neural-networks","pytorch","self-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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/THUDM.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}},"created_at":"2022-05-21T03:45:02.000Z","updated_at":"2025-03-28T06:14:09.000Z","dependencies_parsed_at":"2024-01-18T13:17:23.627Z","dependency_job_id":null,"html_url":"https://github.com/THUDM/GraphMAE","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/THUDM%2FGraphMAE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FGraphMAE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FGraphMAE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FGraphMAE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/THUDM","download_url":"https://codeload.github.com/THUDM/GraphMAE/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339147,"owners_count":20923013,"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","graph-neural-networks","pytorch","self-supervised-learning"],"created_at":"2024-11-14T06:26:15.996Z","updated_at":"2025-04-05T13:01:50.664Z","avatar_url":"https://github.com/THUDM.png","language":"Python","readme":"\u003cp\u003e\n  \u003cimg src=\"imgs/fig.png\" width=\"1000\"\u003e\n  \u003cbr /\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003ch1\u003e GraphMAE: Self-Supervised Masked Graph Autoencoders \u003c/h1\u003e\n\n\nImplementation for KDD'22 paper:  [GraphMAE: Self-Supervised Masked Graph Autoencoders](https://arxiv.org/abs/2205.10803).\n\nWe also have a [Chinese blog](https://zhuanlan.zhihu.com/p/520389049) about GraphMAE on Zhihu (知乎), and an [English Blog](https://medium.com/p/7a641f8c66d0#4fae-bff62a5b8b4b) on Medium.\n\nGraphMAE is a generative self-supervised graph learning method, which achieves competitive or better performance than existing contrastive methods on tasks including *node classification*, *graph classification*, and *molecular property prediction*.\n\u003cp\u003e\n  \u003cimg src=\"imgs/compare.png\" width=\"520\"\u003e\u003cimg src=\"imgs/ablation.jpg\" width=\"270\"\u003e\n  \u003cbr /\u003e\n\u003c/p\u003e\n\n\n\u003ch3\u003e ❗ Update \u003c/h3\u003e \n\n[2023-04-12] [GraphMAE2](https://arxiv.org/abs/2304.04779) is published and the code can be found [here](https://github.com/THUDM/GraphMAE2).\n\n[2022-12-14] The PYG implementation of **GraphMAE** for node / graph classification is available at this [branch](https://github.com/THUDM/GraphMAE/tree/pyg). \n\n\u003ch2\u003eDependencies \u003c/h2\u003e\n\n* Python \u003e= 3.7\n* [Pytorch](https://pytorch.org/) \u003e= 1.9.0 \n* [dgl](https://www.dgl.ai/) \u003e= 0.7.2\n* pyyaml == 5.4.1\n\n\n\u003ch2\u003eQuick Start \u003c/h2\u003e\n\nFor quick start, you could run the scripts: \n\n**Node classification**\n\n```bash\nsh scripts/run_transductive.sh \u003cdataset_name\u003e \u003cgpu_id\u003e # for transductive node classification\n# example: sh scripts/run_transductive.sh cora/citeseer/pubmed/ogbn-arxiv 0\nsh scripts/run_inductive.sh \u003cdataset_name\u003e \u003cgpu_id\u003e # for inductive node classification\n# example: sh scripts/run_inductive.sh reddit/ppi 0\n\n# Or you could run the code manually:\n# for transductive node classification\npython main_transductive.py --dataset cora --encoder gat --decoder gat --seed 0 --device 0\n# for inductive node classification\npython main_inductive.py --dataset ppi --encoder gat --decoder gat --seed 0 --device 0\n```\n\nSupported datasets:\n\n* transductive node classification:  `cora`, `citeseer`, `pubmed`, `ogbn-arxiv`\n* inductive node classification: `ppi`, `reddit` \n\nRun the scripts provided or add `--use_cfg` in command to reproduce the reported results.\n\n\n\n**Graph classification**\n\n```bash\nsh scripts/run_graph.sh \u003cdataset_name\u003e \u003cgpu_id\u003e\n# example: sh scripts/run_graph.sh mutag/imdb-b/imdb-m/proteins/... 0 \n\n# Or you could run the code manually:\npython main_graph.py --dataset IMDB-BINARY --encoder gin --decoder gin --seed 0 --device 0\n```\n\nSupported datasets: \n\n- `IMDB-BINARY`, `IMDB-MULTI`, `PROTEINS`, `MUTAG`, `NCI1`, `REDDIT-BINERY`, `COLLAB`\n\nRun the scripts provided or add `--use_cfg` in command to reproduce the reported results.\n\n\n\n**Molecular Property Prediction**\n\nPlease refer to codes in `./chem` for *molecular property prediction*.\n\n\u003ch2\u003e Datasets \u003c/h2\u003e\n\nDatasets used in node classification and graph classification will be downloaded automatically from https://www.dgl.ai/ when running the code.\n\n\u003ch2\u003e Experimental Results \u003c/h2\u003e\n\nNode classification (Micro-F1, %):\n\n|                    | Cora         | Citeseer     | PubMed       | Ogbn-arxiv     | PPI            | Reddit         |\n| ------------------ | ------------ | ------------ | ------------ | -------------- | -------------- | -------------- |\n| DGI                | 82.3±0.6     | 71.8±0.7     | 76.8±0.6     | 70.34±0.16     | 63.80±0.20     | 94.0±0.10      |\n| MVGRL              | 83.5±0.4     | 73.3±0.5     | 80.1±0.7     | -              | -              | -              |\n| BGRL               | 82.7±0.6     | 71.1±0.8     | 79.6±0.5     | 71.64±0.12     | 73.63±0.16     | 94.22±0.03     |\n| CCA-SSG            | 84.0±0.4     | 73.1±0.3     | 81.0±0.4     | 71.24±0.20     | 73.34±0.17     | 95.07±0.02     |\n| **GraphMAE(ours)** | **84.2±0.4** | **73.4±0.4** | **81.1±0.4** | **71.75±0.17** | **74.50±0.29** | **96.01±0.08** |\n\nGraph classification (Accuracy, %)\n\n|                    | IMDB-B         | IMDB-M         | PROTEINS       | COLLAB         | MUTAG          | REDDIT-B       | NCI1           |\n| ------------------ | -------------- | -------------- | -------------- | -------------- | -------------- | -------------- | -------------- |\n| InfoGraph          | 73.03±0.87     | 49.69±0.53     | 74.44±0.31     | 70.65±1.13     | 89.01±1.13     | 82.50±1.42     | 76.20±1.06     |\n| GraphCL            | 71.14±0.44     | 48.58±0.67     | 74.39±0.45     | 71.36±1.15     | 86.80±1.34     | **89.53±0.84** | 77.87±0.41     |\n| MVGRL              | 74.20±0.70     | 51.20±0.50     | -              | -              | **89.70±1.10** | 84.50±0.60     | -              |\n| **GraphMAE(ours)** | **75.52±0.66** | **51.63±0.52** | **75.30±0.39** | **80.32±0.46** | 88.19±1.26     | 88.01±0.19     | **80.40±0.30** |\n\nTransfer learning on molecular property prediction (ROC-AUC, %): \n\n|                    | BBBP         | Tox21        | ToxCast      | SIDER        | ClinTox      | MUV          | HIV          | BACE         | Avg.     |\n| ------------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | -------- |\n| AttrMasking        | 64.3±2.8     | **76.7±0.4** | **64.2±0.5** | 61.0±0.7     | 71.8±4.1     | 74.7±1.4     | 77.2±1.1     | 79.3±1.6     | 71.1     |\n| GraphCL            | 69.7±0.7     | 73.9±0.7     | 62.4±0.6     | 60.5±0.9     | 76.0±2.7     | 69.8±2.7     | **78.5±1.2** | 75.4±1.4     | 70.8     |\n| GraphLoG           | **72.5±0.8** | 75.7±0.5     | 63.5±0.7     | **61.2±1.1** | 76.7±3.3     | 76.0±1.1     | 77.8±0.8     | **83.5±1.2** | 73.4     |\n| **GraphMAE(ours)** | 72.0±0.6     | 75.5±0.6     | 64.1±0.3     | 60.3±1.1     | **82.3±1.2** | **76.3±2.4** | 77.2±1.0     | 83.1±0.9     | **73.8** |\n\n\u003ch1\u003e Citing \u003c/h1\u003e\n\nIf you find this work is helpful to your research, please consider citing our paper:\n\n```\n@inproceedings{hou2022graphmae,\n  title={GraphMAE: Self-Supervised Masked Graph Autoencoders},\n  author={Hou, Zhenyu and Liu, Xiao and Cen, Yukuo and Dong, Yuxiao and Yang, Hongxia and Wang, Chunjie and Tang, Jie},\n  booktitle={Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining},\n  pages={594--604},\n  year={2022}\n}\n```\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthudm%2Fgraphmae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthudm%2Fgraphmae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthudm%2Fgraphmae/lists"}