opengsl


Nameopengsl JSON
Version 0.0.55 PyPI version JSON
download
home_pagehttps://github.com/OpenGSL/OpenGSL
SummaryA comprehensive benchmark for Graph Structure Learning.
upload_time2023-11-01 10:08:23
maintainer
docs_urlNone
authorZhiyao Zhou, Sheng Zhou, Bochao Mao, Xuanyi Zhou
requires_python>=3.7.0
license
keywords ai gnn graph structure learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
<img src="https://github.com/OpenGSL/OpenGSL/blob/main/docs/source/img/opengsl.jpg" border="0" width=600px/>
</div>


------

<p align="center">
  <a href="#opengsl">Overview</a> •
  <a href="#installation">Installation</a> •
  <a href="https://github.com/OpenGSL/OpenGSL/tree/main/examples">Examples</a> •
  <a href="https://opengsl.readthedocs.io/en/latest/index.html">Docs</a> •
  <a href="#citation">Citation</a> 
</p>

[![Documentation Status](https://readthedocs.org/projects/opengsl/badge/?version=latest)](https://opengsl.readthedocs.io/en/latest/?badge=latest)
[![license](https://badgen.net/github/license/opengsl/opengsl?color=green)](https://github.com/opengsl/opengsl/blob/main/LICENSE)
![version](https://img.shields.io/badge/version-0.0.5-blue)


# OpenGSL
Official code for [OpenGSL: A Comprehensive Benchmark for Graph Structure Learning](https://arxiv.org/abs/2306.10280). OpenGSL is a comprehensive benchmark for **Graph Structure Learning(GSL)**. GSL is a family of data-centric learning approaches which jointly optimize the graph structure and the corresponding GNN models. It has great potential in many real-world applications, including disease analysis, protein structure prediction, etc.

## Overview of the Benchmark
OpenGSL provides a fair and comprehensive platform to evaluate existing GSL works and facilitate future GSL research.

![timeline](https://github.com/OpenGSL/OpenGSL/blob/main/docs/source/img/timeline.png)

## Installation
<!--
[PyTorch](https://pytorch.org/get-started/previous-versions/)
[PyTorch Geometric, PyTorch Sparse](https://data.pyg.org/whl/)
[DEEP GRAPH LIBRARY (DGL)](https://data.dgl.ai/wheels/repo.html)
-->
**Note:** OpenGSL depends on [PyTorch](https://pytorch.org/), [PyTorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html), [PyTorch Sparse](https://github.com/rusty1s/pytorch_sparse) and [DEEP GRAPH LIBRARY (DGL)](https://www.dgl.ai/pages/start.html). To streamline the installation, OpenGSL does **NOT** install these libraries for you. Please install them from the above links for running OpenGSL:

- torch>=1.9.1
- torch_geometric>=2.1.0
- torch_sparse>=0.6.12
- dgl>=0.9.0

**Installing with Pip**
``` bash
pip install opengsl
```

**Installation for local development:**
``` bash
git clone https://github.com/OpenGSL/OpenGSL
cd opengsl
pip install -e .
```

#### Required Dependencies:
- Python 3.7+
- ruamel.yaml
- pandas
- scipy
- scikit-learn
- pyro-api
- pyro-ppl
- numba


## 🚀Quick Start

You can use the command `python examples/gcn_cora.py` or follow the 4 steps.

The following example shows you how to run [GRCN](https://arxiv.org/abs/1911.07123) on the Cora dataset. 

#### Step 1: Load configuration

``` python
import opengsl
conf = opengsl.config.load_conf(method="grcn", dataset="cora")
```

##### Method and Dataset parameters in Built-in configuration (Updated Frequently)

**method** : 
`gcn`, `prognn`, `idgl`, `grcn`, `gaug`, `slaps`, `nodeformer`, `gen`, `cogsl`, `segsl`, `sublime`, `stable`, `wsgnn`, `glcn`, `bmgcn`

**dataset** : 
`cora`, `pubmed`, `citeseer`, `blogcatalog`, `flickr`, `amazon-ratings`, `questions`,  `minesweeper`, `roman-empire`, `wiki-cooc`, `wikics`


#### Step 2: Load data
``` python
dataset = opengsl.data.Dataset("cora", n_splits=1, feat_norm=conf.dataset['feat_norm'])
```

#### Step 3: Build Model
``` python
solver = opengsl.method.GRCNSolver(conf,dataset)
```

#### Step 4: Training and Evaluation
``` python
exp = opengsl.ExpManager(solver)
exp.run(n_runs = 10)
```

## ⚙️Build Your Own GSL
OpenGSL provides an easy way to build GSL algorithm based on several components.

if you want to learn how to build own GSL method, see [Build Your Own GSL.ipynb](https://github.com/OpenGSL/OpenGSL/blob/main/examples/graph%20structure%20learning%20pipeline.ipynb) for more details.

## 📱️Updates
2023.11.1 Version 0.0.6 available!
* **A General GSL model** added. 
* New GSL methods WSGNN, GLCN and BMGCN added.
* New datasets including Wikics, Ogbn-arxiv and CSBM synthetic graphs.
* APPNP and GIN can be used as backbones for various GSL methods.
* Other minor updates.



## How to Contribute

As an active research topic, we are witnessing the rapid development of GSL methods.
Hence, this project will be frequently updated, and we welcome everyone interested in this topic to contribute! 

Please feel free to send PR or issue!

## Citation
Our paper on this benchmark will be released soon!

If you use our benchmark in your works, we would appreciate citations to the paper:

```bibtex
@article{zhou2023opengsl,
  title={OpenGSL: A Comprehensive Benchmark for Graph Structure Learning},
  author={Zhiyao Zhou, Sheng Zhou, Bochao Mao, Xuanyi Zhou, Jiawei Chen, Qiaoyu Tan, Daochen Zha, Can Wang, Yan Feng, Chun Chen},
  journal={arXiv preprint arXiv:2306.10280},
  year={2023}
}
```

## Reference

| **ID** | **Paper** | **Method** | **Conference** |
|--------|---------|:----------:|:--------------:|
| 1      | [Semi-supervised classification with graph convolutional networks](https://arxiv.org/pdf/1609.02907.pdf%EF%BC%89)      |    GCN     |   ICLR 2017    |
| 2      | [Learning Discrete Structures for Graph Neural Networks](https://arxiv.org/abs/1903.11960) |    LDS     |   ICML 2019    |
| 3      | [Graph Structure Learning for Robust Graph Neural Networks](https://dl.acm.org/doi/pdf/10.1145/3394486.3403049)  |   ProGNN   |    KDD 2020    |
| 4      | [Iterative Deep Graph Learning for Graph Neural Networks: Better and Robust Node Embeddings](https://proceedings.neurips.cc/paper/2020/file/e05c7ba4e087beea9410929698dc41a6-Paper.pdf)  |    IDGL    |  NeurIPS 2020  |
| 5      | [Graph-Revised Convolutional Network](https://arxiv.org/pdf/1911.07123)  |    GRCN    | ECML-PKDD 2020 |
| 6      | [Data Augmentation for Graph Neural Networks](https://ojs.aaai.org/index.php/AAAI/article/view/17315/17122)  |  GAug(O)   |   AAAI 2021    |
| 7      | [SLAPS: Self-Supervision Improves Structure Learning for Graph Neural Networks](https://proceedings.neurips.cc/paper/2021/file/bf499a12e998d178afd964adf64a60cb-Paper.pdf)  |   SLAPS    |   ICML 2021    |
| 8      | [Variational Inference for Training Graph Neural Networks in Low-Data Regime through Joint Structure-Label Estimation](https://dl.acm.org/doi/abs/10.1145/3534678.3539283) |   WSGNN    |    KDD 2022    |
| 9      | [Nodeformer: A scalable graph structure learning transformer for node classification](https://proceedings.neurips.cc/paper_files/paper/2022/file/af790b7ae573771689438bbcfc5933fe-Paper-Conference.pdf)  | Nodeformer |  NeurIPS 2022  |
| 10     | [Graph Structure Estimation Neural Networks](http://shichuan.org/doc/103.pdf)  |    GEN     |    WWW 2021    |
| 11     | [Compact Graph Structure Learning via Mutual Information Compression](https://arxiv.org/pdf/2201.05540)  |   CoGSL    |    WWW 2022    |
| 12     | [SE-GSL: A General and Effective Graph Structure Learning Framework through Structural Entropy Optimization](https://arxiv.org/pdf/2303.09778)  |   SEGSL    |    WWW 2023    |
| 13     | [Towards Unsupervised Deep Graph Structure Learning](https://arxiv.org/pdf/2201.06367)  |  SUBLIME   |    WWW 2022    |
| 14     | [Reliable Representations Make A Stronger Defender: Unsupervised Structure Refinement for Robust GNN](https://dl.acm.org/doi/pdf/10.1145/3534678.3539484)  |   STABLE   |    KDD 2022    |
| 15     | [Semi-Supervised Learning With Graph Learning-Convolutional Networks](https://ieeexplore.ieee.org/document/8953909/authors#authors)      |    GLCN    |   CVPR 2019    |   
| 15     | [Block Modeling-Guided Graph Convolutional Neural Networks](http://arxiv.org/abs/2112.13507)      |   BM-GCN   |   AAAI 2022    |


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OpenGSL/OpenGSL",
    "name": "opengsl",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7.0",
    "maintainer_email": "",
    "keywords": "AI,GNN,graph structure learning",
    "author": "Zhiyao Zhou, Sheng Zhou, Bochao Mao, Xuanyi Zhou",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/a6/ea/04666b61e2c6637dd1010c7adf7eee4710b6bfd3154f0251a2d3062f0127/opengsl-0.0.55.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\r\n<img src=\"https://github.com/OpenGSL/OpenGSL/blob/main/docs/source/img/opengsl.jpg\" border=\"0\" width=600px/>\r\n</div>\r\n\r\n\r\n------\r\n\r\n<p align=\"center\">\r\n  <a href=\"#opengsl\">Overview</a> \u2022\r\n  <a href=\"#installation\">Installation</a> \u2022\r\n  <a href=\"https://github.com/OpenGSL/OpenGSL/tree/main/examples\">Examples</a> \u2022\r\n  <a href=\"https://opengsl.readthedocs.io/en/latest/index.html\">Docs</a> \u2022\r\n  <a href=\"#citation\">Citation</a> \r\n</p>\r\n\r\n[![Documentation Status](https://readthedocs.org/projects/opengsl/badge/?version=latest)](https://opengsl.readthedocs.io/en/latest/?badge=latest)\r\n[![license](https://badgen.net/github/license/opengsl/opengsl?color=green)](https://github.com/opengsl/opengsl/blob/main/LICENSE)\r\n![version](https://img.shields.io/badge/version-0.0.5-blue)\r\n\r\n\r\n# OpenGSL\r\nOfficial code for [OpenGSL: A Comprehensive Benchmark for Graph Structure Learning](https://arxiv.org/abs/2306.10280). OpenGSL is a comprehensive benchmark for **Graph Structure Learning(GSL)**. GSL is a family of data-centric learning approaches which jointly optimize the graph structure and the corresponding GNN models. It has great potential in many real-world applications, including disease analysis, protein structure prediction, etc.\r\n\r\n## Overview of the Benchmark\r\nOpenGSL provides a fair and comprehensive platform to evaluate existing GSL works and facilitate future GSL research.\r\n\r\n![timeline](https://github.com/OpenGSL/OpenGSL/blob/main/docs/source/img/timeline.png)\r\n\r\n## Installation\r\n<!--\r\n[PyTorch](https://pytorch.org/get-started/previous-versions/)\r\n[PyTorch Geometric, PyTorch Sparse](https://data.pyg.org/whl/)\r\n[DEEP GRAPH LIBRARY (DGL)](https://data.dgl.ai/wheels/repo.html)\r\n-->\r\n**Note:** OpenGSL depends on [PyTorch](https://pytorch.org/), [PyTorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html), [PyTorch Sparse](https://github.com/rusty1s/pytorch_sparse) and [DEEP GRAPH LIBRARY (DGL)](https://www.dgl.ai/pages/start.html). To streamline the installation, OpenGSL does **NOT** install these libraries for you. Please install them from the above links for running OpenGSL:\r\n\r\n- torch>=1.9.1\r\n- torch_geometric>=2.1.0\r\n- torch_sparse>=0.6.12\r\n- dgl>=0.9.0\r\n\r\n**Installing with Pip**\r\n``` bash\r\npip install opengsl\r\n```\r\n\r\n**Installation for local development:**\r\n``` bash\r\ngit clone https://github.com/OpenGSL/OpenGSL\r\ncd opengsl\r\npip install -e .\r\n```\r\n\r\n#### Required Dependencies:\r\n- Python 3.7+\r\n- ruamel.yaml\r\n- pandas\r\n- scipy\r\n- scikit-learn\r\n- pyro-api\r\n- pyro-ppl\r\n- numba\r\n\r\n\r\n## \ud83d\ude80Quick Start\r\n\r\nYou can use the command `python examples/gcn_cora.py` or follow the 4 steps.\r\n\r\nThe following example shows you how to run [GRCN](https://arxiv.org/abs/1911.07123) on the Cora dataset. \r\n\r\n#### Step 1: Load configuration\r\n\r\n``` python\r\nimport opengsl\r\nconf = opengsl.config.load_conf(method=\"grcn\", dataset=\"cora\")\r\n```\r\n\r\n##### Method and Dataset parameters in Built-in configuration (Updated Frequently)\r\n\r\n**method** \uff1a \r\n`gcn`, `prognn`, `idgl`, `grcn`, `gaug`, `slaps`, `nodeformer`, `gen`, `cogsl`, `segsl`, `sublime`, `stable`, `wsgnn`, `glcn`, `bmgcn`\r\n\r\n**dataset** \uff1a \r\n`cora`, `pubmed`, `citeseer`, `blogcatalog`, `flickr`, `amazon-ratings`, `questions`,  `minesweeper`, `roman-empire`, `wiki-cooc`, `wikics`\r\n\r\n\r\n#### Step 2: Load data\r\n``` python\r\ndataset = opengsl.data.Dataset(\"cora\", n_splits=1, feat_norm=conf.dataset['feat_norm'])\r\n```\r\n\r\n#### Step 3: Build Model\r\n``` python\r\nsolver = opengsl.method.GRCNSolver(conf,dataset)\r\n```\r\n\r\n#### Step 4: Training and Evaluation\r\n``` python\r\nexp = opengsl.ExpManager(solver)\r\nexp.run(n_runs = 10)\r\n```\r\n\r\n## \u2699\ufe0fBuild Your Own GSL\r\nOpenGSL provides an easy way to build GSL algorithm based on several components.\r\n\r\nif you want to learn how to build own GSL method, see [Build Your Own GSL.ipynb](https://github.com/OpenGSL/OpenGSL/blob/main/examples/graph%20structure%20learning%20pipeline.ipynb) for more details.\r\n\r\n## \ud83d\udcf1\ufe0fUpdates\r\n2023.11.1 Version 0.0.6 available!\r\n* **A General GSL model** added. \r\n* New GSL methods WSGNN, GLCN and BMGCN added.\r\n* New datasets including Wikics, Ogbn-arxiv and CSBM synthetic graphs.\r\n* APPNP and GIN can be used as backbones for various GSL methods.\r\n* Other minor updates.\r\n\r\n\r\n\r\n## How to Contribute\r\n\r\nAs an active research topic, we are witnessing the rapid development of GSL methods.\r\nHence, this project will be frequently updated, and we welcome everyone interested in this topic to contribute! \r\n\r\nPlease feel free to send PR or issue!\r\n\r\n## Citation\r\nOur paper on this benchmark will be released soon!\r\n\r\nIf you use our benchmark in your works, we would appreciate citations to the paper:\r\n\r\n```bibtex\r\n@article{zhou2023opengsl,\r\n  title={OpenGSL: A Comprehensive Benchmark for Graph Structure Learning},\r\n  author={Zhiyao Zhou, Sheng Zhou, Bochao Mao, Xuanyi Zhou, Jiawei Chen, Qiaoyu Tan, Daochen Zha, Can Wang, Yan Feng, Chun Chen},\r\n  journal={arXiv preprint arXiv:2306.10280},\r\n  year={2023}\r\n}\r\n```\r\n\r\n## Reference\r\n\r\n| **ID** | **Paper** | **Method** | **Conference** |\r\n|--------|---------|:----------:|:--------------:|\r\n| 1      | [Semi-supervised classification with graph convolutional networks](https://arxiv.org/pdf/1609.02907.pdf%EF%BC%89)      |    GCN     |   ICLR 2017    |\r\n| 2      | [Learning Discrete Structures for Graph Neural Networks](https://arxiv.org/abs/1903.11960) |    LDS     |   ICML 2019    |\r\n| 3      | [Graph Structure Learning for Robust Graph Neural Networks](https://dl.acm.org/doi/pdf/10.1145/3394486.3403049)  |   ProGNN   |    KDD 2020    |\r\n| 4      | [Iterative Deep Graph Learning for Graph Neural Networks: Better and Robust Node Embeddings](https://proceedings.neurips.cc/paper/2020/file/e05c7ba4e087beea9410929698dc41a6-Paper.pdf)  |    IDGL    |  NeurIPS 2020  |\r\n| 5      | [Graph-Revised Convolutional Network](https://arxiv.org/pdf/1911.07123)  |    GRCN    | ECML-PKDD 2020 |\r\n| 6      | [Data Augmentation for Graph Neural Networks](https://ojs.aaai.org/index.php/AAAI/article/view/17315/17122)  |  GAug(O)   |   AAAI 2021    |\r\n| 7      | [SLAPS: Self-Supervision Improves Structure Learning for Graph Neural Networks](https://proceedings.neurips.cc/paper/2021/file/bf499a12e998d178afd964adf64a60cb-Paper.pdf)  |   SLAPS    |   ICML 2021    |\r\n| 8      | [Variational Inference for Training Graph Neural Networks in Low-Data Regime through Joint Structure-Label Estimation](https://dl.acm.org/doi/abs/10.1145/3534678.3539283) |   WSGNN    |    KDD 2022    |\r\n| 9      | [Nodeformer: A scalable graph structure learning transformer for node classification](https://proceedings.neurips.cc/paper_files/paper/2022/file/af790b7ae573771689438bbcfc5933fe-Paper-Conference.pdf)  | Nodeformer |  NeurIPS 2022  |\r\n| 10     | [Graph Structure Estimation Neural Networks](http://shichuan.org/doc/103.pdf)  |    GEN     |    WWW 2021    |\r\n| 11     | [Compact Graph Structure Learning via Mutual Information Compression](https://arxiv.org/pdf/2201.05540)  |   CoGSL    |    WWW 2022    |\r\n| 12     | [SE-GSL: A General and Effective Graph Structure Learning Framework through Structural Entropy Optimization](https://arxiv.org/pdf/2303.09778)  |   SEGSL    |    WWW 2023    |\r\n| 13     | [Towards Unsupervised Deep Graph Structure Learning](https://arxiv.org/pdf/2201.06367)  |  SUBLIME   |    WWW 2022    |\r\n| 14     | [Reliable Representations Make A Stronger Defender: Unsupervised Structure Refinement for Robust GNN](https://dl.acm.org/doi/pdf/10.1145/3534678.3539484)  |   STABLE   |    KDD 2022    |\r\n| 15     | [Semi-Supervised Learning With Graph Learning-Convolutional Networks](https://ieeexplore.ieee.org/document/8953909/authors#authors)      |    GLCN    |   CVPR 2019    |   \r\n| 15     | [Block Modeling-Guided Graph Convolutional Neural Networks](http://arxiv.org/abs/2112.13507)      |   BM-GCN   |   AAAI 2022    |\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A comprehensive benchmark for Graph Structure Learning.",
    "version": "0.0.55",
    "project_urls": {
        "Homepage": "https://github.com/OpenGSL/OpenGSL"
    },
    "split_keywords": [
        "ai",
        "gnn",
        "graph structure learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "31d17bab00eaecd97eeb573c26dbe54f262209007db0b205f85a4033197c24e3",
                "md5": "d9dc25985d055705137f8592be945af3",
                "sha256": "ad988ba921de47a46c2d2be1d71b7aec4dc73a0d63154bf3c79077bece88379a"
            },
            "downloads": -1,
            "filename": "opengsl-0.0.55-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d9dc25985d055705137f8592be945af3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7.0",
            "size": 353805,
            "upload_time": "2023-11-01T10:08:19",
            "upload_time_iso_8601": "2023-11-01T10:08:19.895042Z",
            "url": "https://files.pythonhosted.org/packages/31/d1/7bab00eaecd97eeb573c26dbe54f262209007db0b205f85a4033197c24e3/opengsl-0.0.55-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a6ea04666b61e2c6637dd1010c7adf7eee4710b6bfd3154f0251a2d3062f0127",
                "md5": "b0dad2560be3f41ff6b41acb694474b9",
                "sha256": "d82d27ca163a79dd5e65f0d40f212ed4ae52c25030267153d2cc061047ab22ce"
            },
            "downloads": -1,
            "filename": "opengsl-0.0.55.tar.gz",
            "has_sig": false,
            "md5_digest": "b0dad2560be3f41ff6b41acb694474b9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7.0",
            "size": 109836,
            "upload_time": "2023-11-01T10:08:23",
            "upload_time_iso_8601": "2023-11-01T10:08:23.965616Z",
            "url": "https://files.pythonhosted.org/packages/a6/ea/04666b61e2c6637dd1010c7adf7eee4710b6bfd3154f0251a2d3062f0127/opengsl-0.0.55.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-01 10:08:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OpenGSL",
    "github_project": "OpenGSL",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "opengsl"
}
        
Elapsed time: 0.18692s