{"id":22364739,"url":"https://github.com/ahxt/g2r","last_synced_at":"2026-03-06T12:03:12.014Z","repository":{"id":39717728,"uuid":"496102070","full_name":"ahxt/G2R","owner":"ahxt","description":"[WWW2022] Geometric Graph Representation Learning via Maximizing Rate Reduction","archived":false,"fork":false,"pushed_at":"2022-05-27T00:40:09.000Z","size":1344,"stargazers_count":27,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-18T19:36:34.108Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/ahxt.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}},"created_at":"2022-05-25T06:01:39.000Z","updated_at":"2025-07-18T03:41:47.000Z","dependencies_parsed_at":"2022-09-20T08:51:33.050Z","dependency_job_id":null,"html_url":"https://github.com/ahxt/G2R","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ahxt/G2R","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahxt%2FG2R","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahxt%2FG2R/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahxt%2FG2R/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahxt%2FG2R/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahxt","download_url":"https://codeload.github.com/ahxt/G2R/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahxt%2FG2R/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30175908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T11:48:51.886Z","status":"ssl_error","status_checked_at":"2026-03-06T11:48:51.460Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-12-04T17:25:11.090Z","updated_at":"2026-03-06T12:03:11.994Z","avatar_url":"https://github.com/ahxt.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Geometric Graph Representation Learning via Maximizing Rate Reduction\n\nImplementaion for WWW2022 paper Geometric Graph Representation Learning via Maximizing Rate Reduction [[proceedings]](https://dl.acm.org/doi/10.1145/3485447.3512170) [[arxiv]](https://arxiv.org/abs/2202.06241).\n\n## 1. Introduction\n\nWe propose **G**eometric **G**raph **R**epresentation Learning ($\\mathrm{G}^2\\mathrm{R}$) to learn node representations in an unsupervised manner via maximizing rate reduction. In this way, $\\mathrm{G}^2\\mathrm{R}$ maps nodes in distinct groups (implicitly stored in the adjacency matrix) into different subspaces, while each subspace is compact and different subspaces are dispersedly distributed. $\\mathrm{G}^2\\mathrm{R}$ adopts a graph neural network as the encoder and maximizes the rate reduction with the adjacency matrix. Furthermore, we theoretically and empirically demonstrate that rate reduction maximization is equivalent to maximizing the principal angles between different subspaces.\n\n\n\u003cimg src=\"img/model.png\" style=\"zoom:100%;\" /\u003e\n\n\n\n## 2. Examples\n1. We provide a [Jupyter Notebook](src/orthogonality_visualization_figure3_in_the_paper.ipynb) to reproduce the orthogonality visualization results (Figure 3) in Section 5.3, which shows the (nearly) orthogonality of\nnode representations in the two classes.\n\n\u003cimg src=\"img/orth.png\" style=\"zoom:100%;\" /\u003e\n\n2. We also provide the trianing log on Cora dataset in the [Jupyter Notebook](src/orthogonality_visualization_figure3_in_the_paper.ipynb).\n\n\n\n## 3. Run\n\n1. Requirements\n\n```txt\ntorch==1.7.1\ntorch_geometric==1.6.3\n```\n\n\n2. Data\n\nWe use the dataset built in torch_geometric. The dataset will be downloaded automatically.\n\n\n3. Run Experiments\n   run the following examples on Cora, CiteSeer, PubMed dataset.\n\n```bash\npython -u G2R.py --dataset Cora --num_epochs 20 --num_layers 1 --num_node_batch 768 --num_hidden 1024 --num_out 512 --gam1 0.5 --gam2 0.5 --eps 0.05 --seed 21415 --split fixed\n```\n\n```bash\npython -u G2R.py --dataset CiteSeer --num_epochs 20 --num_layers 1 --num_node_batch 512 --num_hidden 1024 --num_out 512 --gam1 0.5 --gam2 0.5 --eps 0.1 --seed 21415 --split fixed\n```\n\n```bash\npython -u G2R.py --dataset PubMed --num_epochs 40 --num_layers 1 --num_node_batch 200 --num_hidden 1024 --num_out 512 --gam1 0.5 --gam2 0.5 --eps 0.05 --seed 21415 --split fixed\n```\n\n\n## 4. Acknowledgments\n\nThe basic technique used in our paper originated from [Learning diverse and discriminative representations via the principle of maximal coding rate reduction](https://proceedings.neurips.cc/paper/2020/file/6ad4174eba19ecb5fed17411a34ff5e6-Paper.pdf), Yu, Yaodong, Kwan Ho Ryan Chan, Chong You, Chaobing Song, and Yi Ma, NeurIPS2020.\nWe would like to thank the authors for their great paper, which inspires me.\n\n## 5. License\n\nMIT\n\n## 6. Cite Our Paper\n\nIf you use this code in your research, please cite our paper.\n\n```\n@inproceedings{han2022geometric,\n  title={Geometric Graph Representation Learning via Maximizing Rate Reduction},\n  author={Han, Xiaotian and Jiang, Zhimeng and Liu, Ninghao and Song, Qingquan and Li, Jundong and Hu, Xia},\n  booktitle={Proceedings of the ACM Web Conference 2022},\n  pages={1226--1237},\n  year={2022}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahxt%2Fg2r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahxt%2Fg2r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahxt%2Fg2r/lists"}