From 3c92769601daaf6a67e038d0495507b9d73b915a Mon Sep 17 00:00:00 2001 From: nyLiao <39255546+nyLiao@users.noreply.github.com> Date: Fri, 14 Jun 2024 02:05:20 +0800 Subject: [PATCH] Include benchmark in docs --- README.md | 7 +- benchmark/dataset_process/__init__.py | 8 +- benchmark/dataset_process/linkx.py | 14 ++-- benchmark/trainer/__init__.py | 8 ++ benchmark/utils/__init__.py | 6 ++ .../_include/benchmark.dataset_process.rst | 8 ++ docs/source/_include/benchmark.trainer.rst | 53 ++++++++++++ docs/source/_include/benchmark.utils.rst | 21 +++++ docs/source/_templates/apidoc/module.rst_t | 8 ++ docs/source/_templates/apidoc/package.rst_t | 52 ++++++++++++ docs/source/_templates/apidoc/toc.rst_t | 7 ++ docs/source/_templates/autosummary/class.rst | 36 ++++----- docs/source/_templates/autosummary/module.rst | 59 ++++++++------ docs/source/arrangement.md | 4 + docs/source/conf.py | 6 +- docs/source/customization.rst | 4 +- docs/source/index.rst | 81 +++++-------------- docs/source/installation.rst | 69 ++++++++++++++++ docs/source/reproduce.rst | 45 +++++++++++ 19 files changed, 375 insertions(+), 121 deletions(-) create mode 100644 docs/source/_include/benchmark.dataset_process.rst create mode 100644 docs/source/_include/benchmark.trainer.rst create mode 100644 docs/source/_include/benchmark.utils.rst create mode 100644 docs/source/_templates/apidoc/module.rst_t create mode 100644 docs/source/_templates/apidoc/package.rst_t create mode 100644 docs/source/_templates/apidoc/toc.rst_t create mode 100644 docs/source/installation.rst create mode 100644 docs/source/reproduce.rst diff --git a/README.md b/README.md index aebe3fc..eec2ef5 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # Benchmarking Spectral Graph Neural Networks -[![Docs](https://github.com/gdmnl/Spectral-GNN-Benchmark/workflows/Docs/badge.svg)](https://pages.github.com/gdmnl/Spectral-GNN-Benchmark/) +[![Docs](https://github.com/gdmnl/Spectral-GNN-Benchmark/actions/workflows/docs.yaml/badge.svg)](https://gdmnl.github.io/Spectral-GNN-Benchmark/) +[![LICENSE](https://img.shields.io/github/license/gdmnl/Spectral-GNN-Benchmark)](LICENSE) +[![Release](https://img.shields.io/github/v/release/gdmnl/Spectral-GNN-Benchmark?include_prereleases)](https://github.com/gdmnl/Spectral-GNN-Benchmark/releases) +[![Python](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fgdmnl%2FSpectral-GNN-Benchmark%2Fmain%2Fpyproject.toml)]() `pyg_spectral` is a [PyTorch Geometric](https://pyg.org)-based framework for analyzing, implementing, and benchmarking spectral GNNs with effectiveness and efficiency evaluations. @@ -13,6 +16,8 @@ --- +[**Documentation**](https://gdmnl.github.io/Spectral-GNN-Benchmark/) | [**GitHub**](https://github.com/gdmnl/Spectral-GNN-Benchmark/) + - [Installation](#installation) - [Reproduce Experiments](#reproduce-experiments) - [Main Experiments](#main-experiments) diff --git a/benchmark/dataset_process/__init__.py b/benchmark/dataset_process/__init__.py index 7b8821d..51abcd5 100644 --- a/benchmark/dataset_process/__init__.py +++ b/benchmark/dataset_process/__init__.py @@ -7,4 +7,10 @@ split_random, even_quantile_labels, get_iso_nodes_mapping -) \ No newline at end of file +) + +__all__ = [ + 'Yandex', 'LINKX', 'FB100', + 'Filter', + 'idx2mask', 'split_random', 'even_quantile_labels', 'get_iso_nodes_mapping' +] diff --git a/benchmark/dataset_process/linkx.py b/benchmark/dataset_process/linkx.py index f9178d8..ae0d24f 100644 --- a/benchmark/dataset_process/linkx.py +++ b/benchmark/dataset_process/linkx.py @@ -22,7 +22,7 @@ class LINKX(InMemoryDataset): paper: Large Scale Learning on Non-Homophilous Graphs: New Benchmarks and Strong Simple Methods ref: https://github.com/CUAI/Non-Homophily-Large-Scale/ """ - dataset_drive_url = { + _dataset_drive_url = { 'snap-patents.mat' : '1ldh23TSY1PwXia6dU0MYcpyEgX-w3Hia', 'pokec.mat' : '1dNs5E7BrWJbgcHeQ_zuy5Ozp2tRCWG0y', 'yelp-chi.mat': '1fAXtTVQS4CfEk4asqrFw9EPmlUPGbGtJ', @@ -32,7 +32,7 @@ class LINKX(InMemoryDataset): 'wiki_edges.pt': '14X7FlkjrlUgmnsYtPwdh-gGuFla4yb5u', # Wiki 1.9M 'wiki_features.pt': '1ySNspxbK-snNoAZM7oxiWGvOnTRdSyEK' # Wiki 1.9M } - splits_drive_url = { + _splits_drive_url = { 'snap-patents_splits.npy' : '12xbBRqd8mtG_XkNLH8dRRNZJvVM4Pw-N', 'pokec_splits.npy' : '1ZhpAiyTNc0cE_hhgyiqxnkKREHK7MK-_', } @@ -76,12 +76,12 @@ def download(self) -> None: download_url(f'{url}/{self.name}.mat', self.raw_dir) return - for fname in self.dataset_drive_url: + for fname in self._dataset_drive_url: if fname.startswith(self.name): - download_google_url(self.dataset_drive_url[fname], self.raw_dir, filename=fname) - for fname in self.splits_drive_url: + download_google_url(self._dataset_drive_url[fname], self.raw_dir, filename=fname) + for fname in self._splits_drive_url: if fname.startswith(self.name): - download_google_url(self.splits_drive_url[fname], self.raw_dir, filename=fname) + download_google_url(self._splits_drive_url[fname], self.raw_dir, filename=fname) def process(self) -> None: if self.name in ['twitch-gamer']: @@ -118,7 +118,7 @@ def process(self) -> None: edge_index = coalesce(edge_index, num_nodes=n) kwargs = {'x': x, 'edge_index': edge_index, 'y': y} - splits_keys = [k.split('_')[0] for k in self.splits_drive_url] + splits_keys = [k.split('_')[0] for k in self._splits_drive_url] if self.name in splits_keys: # 50/25/25 train/valid/test split splits_lst = np.load(osp.join(self.raw_dir, f'{self.name}_splits.npy'), allow_pickle=True) diff --git a/benchmark/trainer/__init__.py b/benchmark/trainer/__init__.py index cdeed9e..066ee5e 100755 --- a/benchmark/trainer/__init__.py +++ b/benchmark/trainer/__init__.py @@ -3,3 +3,11 @@ from .base import TrnBase_Trial from .fullbatch import TrnFullbatch from .minibatch import TrnMinibatch, TrnMinibatch_Trial + +__all__ = [ + 'SingleGraphLoader', 'SingleGraphLoader_Trial', + 'ModelLoader', 'ModelLoader_Trial', + 'TrnBase_Trial', + 'TrnFullbatch', + 'TrnMinibatch', 'TrnMinibatch_Trial', +] diff --git a/benchmark/utils/__init__.py b/benchmark/utils/__init__.py index cf769df..4509c9c 100755 --- a/benchmark/utils/__init__.py +++ b/benchmark/utils/__init__.py @@ -3,3 +3,9 @@ force_list_str, force_list_int, list_str, list_int, list_float,) from .logger import setup_logger, clear_logger, setup_logpath, ResLogger from .checkpoint import CkptLogger + +__all__ = [ + 'setup_seed', 'setup_argparse', 'setup_args', 'save_args', 'dict_to_json', + 'setup_logger', 'clear_logger', 'setup_logpath', 'ResLogger', + 'CkptLogger', +] diff --git a/docs/source/_include/benchmark.dataset_process.rst b/docs/source/_include/benchmark.dataset_process.rst new file mode 100644 index 0000000..bc0ed75 --- /dev/null +++ b/docs/source/_include/benchmark.dataset_process.rst @@ -0,0 +1,8 @@ +benchmark.dataset\_process +======================== + +.. automodule:: benchmark.dataset_process + :members: + :undoc-members: + :show-inheritance: + :private-members: diff --git a/docs/source/_include/benchmark.trainer.rst b/docs/source/_include/benchmark.trainer.rst new file mode 100644 index 0000000..35b95a8 --- /dev/null +++ b/docs/source/_include/benchmark.trainer.rst @@ -0,0 +1,53 @@ +benchmark.trainer +=============== + +.. automodule:: benchmark.trainer + :members: + :undoc-members: + :show-inheritance: + :private-members: + +benchmark.trainer.base +------------------- + +.. automodule:: benchmark.trainer.base + :members: + :undoc-members: + :show-inheritance: + :private-members: + +benchmark.trainer.filter +--------------------- + +.. automodule:: benchmark.trainer.filter + :members: + :undoc-members: + :show-inheritance: + :private-members: + +benchmark.trainer.load\_data +------------------------- + +.. automodule:: benchmark.trainer.load_data + :members: + :undoc-members: + :show-inheritance: + :private-members: + +benchmark.trainer.load\_metric +--------------------------- + +.. automodule:: benchmark.trainer.load_metric + :members: + :undoc-members: + :show-inheritance: + :private-members: + +benchmark.trainer.load\_model +-------------------------- + +.. automodule:: benchmark.trainer.load_model + :members: + :undoc-members: + :show-inheritance: + :private-members: diff --git a/docs/source/_include/benchmark.utils.rst b/docs/source/_include/benchmark.utils.rst new file mode 100644 index 0000000..5679dd1 --- /dev/null +++ b/docs/source/_include/benchmark.utils.rst @@ -0,0 +1,21 @@ +benchmark.utils +============= + +.. automodule:: benchmark.utils + :members: + :undoc-members: + :show-inheritance: + :private-members: + + +benchmark.utils.config +------------------- + +.. autosummary:: + :recursive: + + config.force_list_str + config.force_list_int + config.list_str + config.list_int + config.list_float diff --git a/docs/source/_templates/apidoc/module.rst_t b/docs/source/_templates/apidoc/module.rst_t new file mode 100644 index 0000000..2644b73 --- /dev/null +++ b/docs/source/_templates/apidoc/module.rst_t @@ -0,0 +1,8 @@ +{%- if show_headings %} +{{- [basename] | join(' ') | e | heading }} + +{% endif -%} +.. automodule:: {{ qualname }} +{%- for option in automodule_options %} + :{{ option }}: +{%- endfor %} diff --git a/docs/source/_templates/apidoc/package.rst_t b/docs/source/_templates/apidoc/package.rst_t new file mode 100644 index 0000000..dcaef6f --- /dev/null +++ b/docs/source/_templates/apidoc/package.rst_t @@ -0,0 +1,52 @@ +{%- macro automodule(modname, options) -%} +.. automodule:: {{ modname }} +{%- for option in options %} + :{{ option }}: +{%- endfor %} +{%- endmacro %} + +{%- macro toctree(docnames) -%} +.. toctree:: +{% for docname in docnames %} + {{ docname }} +{%- endfor %} +{%- endmacro %} + +{%- if is_namespace %} +{{- [pkgname, "namespace"] | join(" ") | e | heading }} +{% else %} +{{- [pkgname] | join(" ") | e | heading }} +{% endif %} + +{%- if modulefirst and not is_namespace %} +{{ automodule(pkgname, automodule_options) }} +{% endif %} + +{%- if subpackages %} +Subpackages +----------- + +{{ toctree(subpackages) }} +{% endif %} + +{%- if submodules %} +Submodules +---------- +{% if separatemodules %} +{{ toctree(submodules) }} +{%- else %} +{%- for submodule in submodules %} +{% if show_headings %} +{{- [submodule] | join(" ") | e | heading(2) }} +{% endif %} +{{ automodule(submodule, automodule_options) }} +{% endfor %} +{%- endif %} +{% endif %} + +{%- if not modulefirst and not is_namespace %} +Module contents +--------------- + +{{ automodule(pkgname, automodule_options) }} +{% endif %} diff --git a/docs/source/_templates/apidoc/toc.rst_t b/docs/source/_templates/apidoc/toc.rst_t new file mode 100644 index 0000000..878540c --- /dev/null +++ b/docs/source/_templates/apidoc/toc.rst_t @@ -0,0 +1,7 @@ +{{ header | heading }} + +.. toctree:: + :maxdepth: {{ maxdepth }} +{% for docname in docnames %} + {{ docname }} +{%- endfor %} diff --git a/docs/source/_templates/autosummary/class.rst b/docs/source/_templates/autosummary/class.rst index c188ac6..b5c1ba8 100644 --- a/docs/source/_templates/autosummary/class.rst +++ b/docs/source/_templates/autosummary/class.rst @@ -5,27 +5,25 @@ .. autoclass:: {{ objname }} {% block methods %} - {% block attributes %} - {% if attributes %} - .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. - .. autosummary:: - :toctree: - {% for item in all_attributes %} - {%- if not item.startswith('_') %} - {{ name }}.{{ item }} - {%- endif -%} - {%- endfor %} + .. automethod:: __init__ + + {% if methods %} + .. rubric:: Methods + + .. autosummary:: + {% for item in methods %} + ~{{ name }}.{{ item }} + {%- endfor %} {% endif %} {% endblock %} - {% if methods %} - .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. - .. autosummary:: - :toctree: - {% for item in all_methods %} - {%- if not item.startswith('_') or item in ['__call__'] %} - {{ name }}.{{ item }} - {%- endif -%} - {%- endfor %} + {% block attributes %} + {% if attributes %} + .. rubric:: Attributes + + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} {% endif %} {% endblock %} \ No newline at end of file diff --git a/docs/source/_templates/autosummary/module.rst b/docs/source/_templates/autosummary/module.rst index 76d1c8e..6ec89e0 100644 --- a/docs/source/_templates/autosummary/module.rst +++ b/docs/source/_templates/autosummary/module.rst @@ -1,29 +1,36 @@ -{{ fullname | escape | underline }} - -.. rubric:: Description +{{ fullname | escape | underline}} .. automodule:: {{ fullname }} -.. currentmodule:: {{ fullname }} - -{% if classes %} -.. rubric:: Classes - -.. autosummary:: - :toctree: . - {% for class in classes %} - {{ class }} - {% endfor %} - -{% endif %} - -{% if functions %} -.. rubric:: Functions - -.. autosummary:: - :toctree: . - {% for function in functions %} - {{ function }} - {% endfor %} - -{% endif %} \ No newline at end of file + {% block functions %} + {% if functions %} + .. rubric:: Functions + + .. autosummary:: + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block classes %} + {% if classes %} + .. rubric:: Classes + + .. autosummary:: + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + .. rubric:: Exceptions + + .. autosummary:: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} diff --git a/docs/source/arrangement.md b/docs/source/arrangement.md index 40c2ac8..d248b9c 100644 --- a/docs/source/arrangement.md +++ b/docs/source/arrangement.md @@ -2,6 +2,8 @@ ## Covered Models +Refer to {py:class}`benchmark.trainer.ModelLoader`. + | **Category** | **Model** | |:------------:|:----------| | Fixed Filter | [GCN](https://arxiv.org/abs/1609.02907), [SGC](https://arxiv.org/pdf/1902.07153), [gfNN](https://arxiv.org/pdf/1905.09550), [GZoom](https://arxiv.org/pdf/1910.02370), [S$^2$GC](https://openreview.net/pdf?id=CYO5T-YjWZV),[GLP](https://arxiv.org/pdf/1901.09993), [APPNP](https://arxiv.org/pdf/1810.05997), [GCNII](https://arxiv.org/pdf/2007.02133), [GDC](https://proceedings.neurips.cc/paper_files/paper/2019/file/23c894276a2c5a16470e6a31f4618d73-Paper.pdf), [DGC](https://arxiv.org/pdf/2102.10739), [AGP](https://arxiv.org/pdf/2106.03058), [GRAND+](https://arxiv.org/pdf/2203.06389)| @@ -11,6 +13,8 @@ ## Covered Datasets +Refer to {py:class}`benchmark.trainer.SingleGraphLoader`. + | **Source** | **Graph** | |:------------:|:----------| | [PyG](https://pytorch-geometric.readthedocs.io/en/stable/modules/datasets.html) | cora, citeseer, pubmed, flickr, actor | diff --git a/docs/source/conf.py b/docs/source/conf.py index 1e0862c..3e7f4fa 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,7 +14,8 @@ author = 'Ningyi Liao' release = '1.0.0' -sys.path.insert(0, osp.abspath('../pyg_spectral')) +sys.path.insert(0, osp.abspath('../../')) +sys.path.insert(1, osp.abspath('../../benchmark')) # sys.path.append(osp.join(osp.dirname(pyg_sphinx_theme.__file__), 'extension')) # -- General configuration --------------------------------------------------- @@ -57,13 +58,14 @@ "github_user": "gdmnl", "github_repo": "Spectral-GNN-Benchmark", "github_version": "main", - "conf_py_path": "/source/", + "conf_py_path": "/docs/source/", } autodoc_default_options = { 'members': True, 'private-members': True, 'undoc-members': True, + 'show_headings': False, } intersphinx_mapping = { diff --git a/docs/source/customization.rst b/docs/source/customization.rst index 69c7e4d..f9fa95d 100644 --- a/docs/source/customization.rst +++ b/docs/source/customization.rst @@ -8,7 +8,7 @@ New spectral filters to :mod:`pyg_spectral.nn.conv` can be easily implemented by Step 1: Define propagation matrix ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The base class :class:`pyg_spectral.nn.conv.base_mp.BaseMP` provides essential methods for building spectral filters. We can define a new filter class :class:`pyg_spectral.nn.conv.SkipConv` by inheriting from it: +The base class :class:`pyg_spectral.nn.conv.BaseMP` provides essential methods for building spectral filters. We can define a new filter class :class:`pyg_spectral.nn.conv.SkipConv` by inheriting from it: .. code-block:: python @@ -124,4 +124,4 @@ Refer to the help text by: Add New Experiment Dataset -------------------------- -In ``benchmark/trainer/load_data.py``, append the :meth:`SingleGraphLoader._resolve_import` method to include new datasets under respective protocols. +Append the :meth:`benchmark.trainer.SingleGraphLoader._resolve_import` method to include new datasets under respective protocols. diff --git a/docs/source/index.rst b/docs/source/index.rst index 74b75bf..351928c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -5,7 +5,7 @@ pyg_spectral ======================================== -``pyg_spectral`` is a `PyTorch Geometric `_-based framework for analyzing, implementing, and benchmarking spectral GNNs with effectiveness and efficiency evaluations. +``pyg_spectral`` is a `PyG `_-based framework for analyzing, implementing, and benchmarking spectral GNNs with effectiveness and efficiency evaluations. *Why this project?* We list the following highlights of our framework compared to PyG and similar works: @@ -16,78 +16,31 @@ pyg_spectral * **High scalability**: As spectral GNNs are inherently suitable for large-scale learning, our framework is feasible to common scalable learning schemes and acceleration techniques. Several spectral-oriented approximation algorithms are also supported. -Installation ----------------------------------------- -This package can be easily installed by running `pip `_ at package root path: +.. include:: installation.rst + :end-before: Advanced Options -.. code-block:: bash - - pip install -r requirements.txt - pip install -e . - -The installation script already covers the following core dependencies: - -- `PyTorch `_ (``>=2.0`` [1]_) -- `PyTorch Geometric `_ (``>=2.5.3``) -- `TorchMetrics `_ (``>=1.0``): only required for ``benchmark/`` experiments. -- `Optuna `_ (``>=3.4``): only required for hyperparameter search in ``benchmark/`` experiments. - -.. [1] Please refer to the `official guide `_ if a specific CUDA version is required for PyTorch. - -Reproduce Experiments ----------------------------------------- - -Main Experiments -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Acquire results on the effectiveness and efficiency of spectral GNNs. -Datasets will be automatically downloaded and processed by the code. - -**Run full-batch models** (*Table 2, 8, 9*): - -.. code-block:: bash - - cd benchmark - bash scripts/runfb.sh - -**Run mini-batch models** (*Table 3, 10, 11*): - -.. code-block:: bash - - bash scripts/runmb.sh - -Additional Experiments -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -**Effect of graph normalization vs degree-specific accuracy** (*Figure 3, 9*): - -.. code-block:: bash - - bash scripts/eval_degree.sh - -Figures can be plotted by: `benchmark/notebook/fig_degng.ipynb `_. - -**Effect of the number of propagation hops vs accuracy** (*Figure 7, 8*): - -.. code-block:: bash - - bash scripts/eval_hop.sh - -Figures can be plotted by: `benchmark/notebook/fig_hop.ipynb `_. - -**Frequency response** (*Table 12*): - -.. code-block:: bash - - bash scripts/exp_filter.sh +For advanced options, please refer to `Installation Options `_. +.. include:: reproduce.rst .. toctree:: :maxdepth: 2 :caption: Getting Started + installation + reproduce customization arrangement +.. toctree:: + :hidden: + :maxdepth: 1 + :caption: Experiments + + _include/benchmark.trainer + _include/benchmark.utils + _include/benchmark.dataset_process + .. toctree:: :hidden: :maxdepth: 1 @@ -99,3 +52,5 @@ Figures can be plotted by: `benchmark/notebook/fig_hop.ipynb `_ if a specific CUDA version is required for PyTorch. diff --git a/docs/source/installation.rst b/docs/source/installation.rst new file mode 100644 index 0000000..17ac687 --- /dev/null +++ b/docs/source/installation.rst @@ -0,0 +1,69 @@ +Installation +---------------------------------------- + +This package can be easily installed by running `pip `_ at package root path: + +.. code-block:: bash + + pip install -r requirements.txt + pip install -e .[benchmark] + +The installation script already covers the following core dependencies: + +- `PyTorch `_ (``>=2.0`` [1]_) +- `PyTorch Geometric `_ (``>=2.5.3``) +- `TorchMetrics `_ (``>=1.0``): only required for ``benchmark/`` experiments. +- `Optuna `_ (``>=3.4``): only required for hyperparameter search in ``benchmark/`` experiments. + + +Advanced Options +++++++++++++++++++++++++ + +Installations can be specified by pip options. The following options can also be combined. + +Only ``pyg_spectral`` Package +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Install without any options: + +.. code-block:: bash + + pip install -r requirements.txt + pip install -e . + +Benchmark Experiments +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Install with ``[benchmark]`` option: + +.. code-block:: bash + + pip install -r requirements.txt + pip install -e .[benchmark] + +Docs Development +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Install with ``[docs]`` option: + +.. code-block:: bash + + pip install -e .[docs] + +C++ Backend +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +1. Ensure C++ 11 is installed. + +.. code-block:: bash + + gcc --version + +2. Install with ``[cpp]`` option and environment variable ``PSFLAG_CPP=1``: + +.. code-block:: bash + + pip install -r requirements.txt + export PSFLAG_CPP=1; pip install -e .[cpp] + +.. [1] Please refer to the `official guide `_ if a specific CUDA version is required for PyTorch. diff --git a/docs/source/reproduce.rst b/docs/source/reproduce.rst new file mode 100644 index 0000000..504f687 --- /dev/null +++ b/docs/source/reproduce.rst @@ -0,0 +1,45 @@ +Reproduce Experiments +---------------------------------------- + +Main Experiments +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Acquire results on the effectiveness and efficiency of spectral GNNs. +Datasets will be automatically downloaded and processed by the code. + +**Run full-batch models** (*Table 2, 8, 9*): + +.. code-block:: bash + + cd benchmark + bash scripts/runfb.sh + +**Run mini-batch models** (*Table 3, 10, 11*): + +.. code-block:: bash + + bash scripts/runmb.sh + +Additional Experiments +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Effect of graph normalization vs degree-specific accuracy** (*Figure 3, 9*): + +.. code-block:: bash + + bash scripts/eval_degree.sh + +Figures can be plotted by: `benchmark/notebook/fig_degng.ipynb `_. + +**Effect of the number of propagation hops vs accuracy** (*Figure 7, 8*): + +.. code-block:: bash + + bash scripts/eval_hop.sh + +Figures can be plotted by: `benchmark/notebook/fig_hop.ipynb `_. + +**Frequency response** (*Table 12*): + +.. code-block:: bash + + bash scripts/exp_filter.sh