{"id":13689451,"url":"https://github.com/Tiiiger/SGC","last_synced_at":"2025-05-01T23:34:45.461Z","repository":{"id":37677270,"uuid":"168286901","full_name":"Tiiiger/SGC","owner":"Tiiiger","description":"official implementation for the paper \"Simplifying Graph Convolutional Networks\"","archived":false,"fork":false,"pushed_at":"2021-12-13T17:45:43.000Z","size":6246,"stargazers_count":831,"open_issues_count":2,"forks_count":146,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-10-14T11:48:47.589Z","etag":null,"topics":["graph","machine-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/Tiiiger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"citation.py","codeowners":null,"security":null,"support":null}},"created_at":"2019-01-30T05:50:17.000Z","updated_at":"2024-10-13T02:15:43.000Z","dependencies_parsed_at":"2022-09-06T16:21:31.228Z","dependency_job_id":null,"html_url":"https://github.com/Tiiiger/SGC","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/Tiiiger%2FSGC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tiiiger%2FSGC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tiiiger%2FSGC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tiiiger%2FSGC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tiiiger","download_url":"https://codeload.github.com/Tiiiger/SGC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224282284,"owners_count":17285799,"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","machine-learning"],"created_at":"2024-08-02T15:01:48.420Z","updated_at":"2024-11-12T13:31:51.214Z","avatar_url":"https://github.com/Tiiiger.png","language":"Python","funding_links":[],"categories":["Python","[Label Inference Methods](#content)"],"sub_categories":["Graph Embedding Approaches"],"readme":"## Simplifying Graph Convolutional Networks\n\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-red.svg)](#python)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) \n\n#### Updates\n* As pointed out by #23, there was a subtle bug in our preprocessing code for the reddit dataset. After fixing this bug, SGC achieves a F1 score of 95.0 (previously, it was 94.9).\n* Practical advice: it is often very helpful to normalize the features to have zero mean with standard deviation one to accelerate the convergence of SGC (and many other linear models). For example, we apply this normalization for [the reddit dataset](./utils.py#L119). Please consider doing this when applying SGC to other datasets. For some relevant discussions, see [Ross et al, 2013](https://arxiv.org/pdf/1305.6646.pdf) and [Li and Zhang, 1998](https://www.jstor.org/stable/25051187?seq=1#metadata_info_tab_contents).\n\n#### Authors: \n* [Felix Wu](https://scholar.google.com.tw/citations?user=sNL8SSoAAAAJ\u0026hl=en)*\n* [Tianyi Zhang](https://scholar.google.com/citations?user=OI0HSa0AAAAJ\u0026hl=en)*\n* [Amauri Holanda de Souza Jr.](https://scholar.google.com/citations?hl=en\u0026user=lP0LBI4AAAAJ\u0026view_op=list_works\u0026sortby=pubdate)*\n* [Christopher Fifty](https://scholar.google.com/citations?user=lg2M2RYAAAAJ\u0026hl=en)\n* [Tao Yu](http://jhc.sjtu.edu.cn/public/home/taoyu/)\n* [Kilian Q. Weinberger](http://kilian.cs.cornell.edu/index.html)\n\n*: Equal Contribution\n\n### Overview\nThis repo contains an example implementation of the Simple Graph Convolution\n(SGC) model, described in the ICML2019 paper [Simplifying Graph Convolutional Networks](https://arxiv.org/abs/1902.07153).\n\nSGC removes the nonlinearities and collapes the weight matrices in Graph Convolutional Networks (GCNs) and is essentially a linear model. \nFor an illustration, ![](./model.jpg \"SGC\")\n\nSGC achieves competitive performance while saving much training time. For reference, on a GTX 1080 Ti,\n\nDataset | Metric | Training Time \n:------:|:------:|:-----------:|\nCora    | Acc: 81.0 %     | 0.13s\nCiteseer| Acc: 71.9 %     | 0.14s\nPubmed  | Acc: 78.9 %     | 0.29s\nReddit  | F1:  94.9 %     | 2.7s\n\nThis home repo contains the implementation for citation networks (Cora, Citeseer, and Pubmed) and social network (Reddit).\nWe have a work-in-progress branch [ablation](https://github.com/Tiiiger/SGC/tree/ablation), containing additional codebase for our ablation studies.\n\nIf you find this repo useful, please cite: \n```\n@InProceedings{pmlr-v97-wu19e,\n  title = \t {Simplifying Graph Convolutional Networks},\n  author = \t {Wu, Felix and Souza, Amauri and Zhang, Tianyi and Fifty, Christopher and Yu, Tao and Weinberger, Kilian},\n  booktitle = \t {Proceedings of the 36th International Conference on Machine Learning},\n  pages = \t {6861--6871},\n  year = \t {2019},\n  publisher = \t {PMLR},\n}\n```\n\n#### Other reference implementations\nOther reference implementations can be found in the follwing libraries. Note that in\nthese examples, the hyperparameters are potentially different and\nthe results would be different from the paper reported ones.\n\n- *Deep Graph Library*: [example](https://github.com/dmlc/dgl/tree/master/examples/pytorch/sgc).\n- *PyTorch Geometric*:\n[documentation](https://pytorch-geometric.readthedocs.io/en/latest/modules/nn.html#torch_geometric.nn.conv.SGConv)\nand [example](https://github.com/rusty1s/pytorch_geometric/blob/master/examples/sgc.py). \n- *Spektral*: [example](https://github.com/danielegrattarola/spektral/blob/master/examples/node_classification_simple_gc.py)\n- *StellarGraph*: [example](https://github.com/stellargraph/stellargraph/blob/develop/demos/node-classification/sgc/sgc-node-classification-example.ipynb)\n- *tf_geometric*: [example](https://github.com/CrawlScript/tf_geometric/blob/master/demo/demo_sgc.py)\n\n### Dependencies\nOur implementation works with PyTorch\u003e=1.0.0 Install other dependencies: `$ pip install -r requirement.txt`\n\n### Data\nWe provide the citation network datasets under `data/`, which corresponds to [the public data splits](https://github.com/tkipf/gcn/tree/master/gcn/data).\nDue to space limit, please download reddit dataset from [FastGCN](https://github.com/matenure/FastGCN/issues/9) and put `reddit_adj.npz`, `reddit.npz` under `data/`.\n\n### Usage\nCitation Networks: We tune the only hyperparameter, weight decay, with hyperopt and put the resulting hyperparameter under `SGC-tuning`. \nSee `tuning.py` for more details on hyperparameter optimization.\n```\n$ python citation.py --dataset cora --tuned\n$ python citation.py --dataset citeseer --tuned --epochs 150 \n$ python citation.py --dataset pubmed --tuned\n```\n\nReddit:\n```\n$ python reddit.py --inductive --test\n```\n### Downstream\nWe collect the code base for downstream tasks under `downstream`. Currently, we\nare releasing only SGC implementation for text classification.\n\n### Acknowledgement\nThis repo is modified from [pygcn](https://github.com/tkipf/pygcn), and [FastGCN](https://github.com/matenure/FastGCN).\n\nWe thank *Deep Graph Library* team for helping providing a reference implementation of SGC and benchmarking SGC in *Deep Graph Library*.\nWe thank Matthias Fey, author of *PyTorch Geometric*, for his help on providing a reference implementation of SGC within *PyTorch Geometric*.\nWe thank Daniele Grattarola, author of *Spektral*, for his help on providing a reference implementation of SGC within *Spektral*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTiiiger%2FSGC","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTiiiger%2FSGC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTiiiger%2FSGC/lists"}