{"id":20216258,"url":"https://github.com/thudm/graphmae2","last_synced_at":"2025-08-04T07:10:37.278Z","repository":{"id":153404934,"uuid":"623770063","full_name":"THUDM/GraphMAE2","owner":"THUDM","description":"GraphMAE2: A Decoding-Enhanced Masked Self-Supervised Graph Learner in WWW'23","archived":false,"fork":false,"pushed_at":"2023-07-06T12:59:18.000Z","size":236,"stargazers_count":156,"open_issues_count":5,"forks_count":14,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-10T15:45:48.113Z","etag":null,"topics":["deep-learning","graph-neural-networks","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":"mit","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-05T03:44:53.000Z","updated_at":"2025-04-03T06:31:38.000Z","dependencies_parsed_at":"2024-11-14T06:27:38.597Z","dependency_job_id":null,"html_url":"https://github.com/THUDM/GraphMAE2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/THUDM/GraphMAE2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FGraphMAE2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FGraphMAE2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FGraphMAE2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FGraphMAE2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/THUDM","download_url":"https://codeload.github.com/THUDM/GraphMAE2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUDM%2FGraphMAE2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268660145,"owners_count":24286028,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","self-supervised-learning"],"created_at":"2024-11-14T06:27:06.349Z","updated_at":"2025-08-04T07:10:37.251Z","avatar_url":"https://github.com/THUDM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e GraphMAE2: A Decoding-Enhanced Masked Self-Supervised\nGraph Learner \u003c/h1\u003e\n\nImplementation for WWW'23 paper:  [GraphMAE2: A Decoding-Enhanced Masked Self-Supervised\nGraph Learner](https://arxiv.org/abs/2304.04779).\n\u003cimg src=\"assets/../asserts/overview.png\"\u003e\n\n[GraphMAE] The predecessor of this work: [GraphMAE: Self-Supervised Masked Graph Autoencoders](https://arxiv.org/abs/2205.10803) can be found [here](https://github.com/THUDM/GraphMAE).\n\n\u003ch3\u003e ❗ Update \u003c/h3\u003e \n\n[2023-04-19] We have made **checkpoints** of pre-trained models on different datasets available - feel free to download them from [Google Drive](https://drive.google.com/drive/folders/1GiuP0PtIZaYlJWIrjvu73ZQCJGr6kGkh).\n\n\u003ch2\u003eDependencies \u003c/h2\u003e\n\n* Python \u003e= 3.7\n* [Pytorch](https://pytorch.org/) \u003e= 1.9.0 \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 run_minibatch.sh \u003cdataset_name\u003e \u003cgpu_id\u003e # for mini batch node classification\n# example: sh run_minibatch.sh ogbn-arxiv 0\nsh run_fullbatch.sh \u003cdataset_name\u003e \u003cgpu_id\u003e # for full batch node classification\n# example: sh run_fullbatch.sh cora 0\n\n# Or you could run the code manually:\n# for mini batch node classification\npython main_large.py --dataset ogbn-arxiv --encoder gat --decoder gat --seed 0 --device 0\n# for full batch node classification\npython main_full_batch.py --dataset cora --encoder gat --decoder gat --seed 0 --device 0\n```\n\nSupported datasets:\n\n* mini batch node classification:  `ogbn-arxiv`, `ogbn-products`, `mag-scholar-f`, `ogbn-papers100M`\n* full batch node classification: `cora`, `citeseer`, `pubmed`\n\nRun the scripts provided or add `--use_cfg` in command to reproduce the reported results.\n\n**For Large scale graphs**\nBefore starting mini-batch training, you'll need to generate local clusters if you want to use local-clustering for training. By default, the program will load dataset from `./data` and save the generated local clusters to `./lc_ego_graphs`. To generate a local cluster,  you should first install [localclustering](https://github.com/kfoynt/LocalGraphClustering) and then run the following command:\n\n```\npython ./datasets/localclustering.py --dataset \u003cyour_dataset\u003e --data_dir \u003cpath_to_data\u003e\n```\nAnd we also provide the pre-generated local clusters which can be downloaded [here](https://cloud.tsinghua.edu.cn/d/64f859f389ca43eda472/) and then put into `lc_ego_graphs` for usage.\n\n\n\n\u003ch2\u003e Datasets \u003c/h2\u003e\n\nDuring the code's execution, the OGB and small-scale datasets (Cora, Citeseer, and PubMed) will be downloaded automatically. For the MAG-SCHOLAR dataset, you can download the raw data from [here](https://figshare.com/articles/dataset/mag_scholar/12696653) or use our processed version, which can be found [here](https://cloud.tsinghua.edu.cn/d/776e73d84d47454c958d/) (the four feature files have to be merged in to a `feature_f.npy`). Once you have the dataset, place it into the `./data/mag_scholar_f` folder for later usage. The folder should contain the following files:\n```\n- mag_scholar_f\n|--- edge_index_f.npy\n|--- split_idx_f.pt\n|--- feature_f.npy\n|--- label_f.npy\n```\n\nSoon, we will provide [SAINTSampler](https://arxiv.org/abs/1907.04931) as the baseline. \n\n\n\u003ch2\u003e Experimental Results \u003c/h2\u003e\n\nExperimental results of node classification on large-scale datasets (Accuracy, %):\n\n|                    | Ogbn-arxiv         | Ogbn-products     | Mag-Scholar-F       | Ogbn-papers100M     | \n| ------------------ | ------------ | ------------ | ------------ | -------------- |\n| MLP                | 55.50±0.23     | 61.06±0.08     | 39.11±0.21     | 47.24±0.31     | \n| SGC              | 66.92±0.08     | 74.87±0.25     | 54.68±0.23     | 63.29±0.19        | \n| Random-Init               | 68.14±0.02     | 74.04±0.06     | 56.57±0.03     | 61.55±0.12     | \n| CCA-SSG            | 68.57±0.02     | 75.27±0.05     | 51.55±0.03     | 55.67±0.15     | \n| GRACE            | 69.34±0.01     | 79.47±0.59     | 57.39±0.02     | 61.21±0.12     | \n| BGRL            | 70.51±0.03     | 78.59±0.02     | 57.57±0.01     | 62.18±0.15     | \n| GGD            | -     | 75.70±0.40     | -     | 63.50±0.50     | \n| GraphMAE            | 71.03±0.02     | 78.89±0.01     | 58.75±0.03     | 62.54±0.09     | \n| **GraphMAE2** | **71.89±0.03** | **81.59±0.02** | **59.24±0.01** | **64.89±0.04** |\n\n\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{hou2023graphmae2,\n  title={GraphMAE2: A Decoding-Enhanced Masked Self-Supervised Graph Learner},\n  author={Zhenyu Hou, Yufei He, Yukuo Cen, Xiao Liu, Yuxiao Dong, Evgeny Kharlamov, Jie Tang},\n  booktitle={Proceedings of the ACM Web Conference 2023 (WWW’23)},\n  year={2023}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthudm%2Fgraphmae2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthudm%2Fgraphmae2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthudm%2Fgraphmae2/lists"}