An open and unified pipeline for Deep Hypergraph Learning (DHGL)
Project description
DHG-Bench
DHG-Bench is a unified library for Deep Hypergraph Learning (DHGL), built on PyTorch and PyTorch Geometric . It integrates 17 state-of-the-art hypergraph neural network (HNN) algorithms and 22 hypergraph datasets with diverse characteristics.
📦 Installation
Follow the steps below to install and configure DHG-Bench properly for your local environment.
Required Dependencies:
DHG-Bench needs the following requirements to be satisfied beforehand:
- Python>=3.9.21
- Pytorch>=2.2.2
- torch_geometric>=2.6.1
- torch-cluster>=1.6.3
- torch-scatter>=2.1.2
- torch-sparse>=0.6.18
- torch-spline-conv>=1.2.2
- deeprobust==0.2.11
- ipdb==0.13.13
- numpy==1.24.3
Installation with pip [Recommended]
pip install dhg-bench
Installation for local development
# download the resporitary
cd dhgbench
# install required dependencies
Download Datasets
We include benchmark datasets in the data.zip archive. Users can simply extract the archive with
unzip data.zip
to obtain the data directory. The project structure should look like the following:
DHG-Bench
├── data
│ ├── fair_data
│ ├── hete_data
| ├── hgcls_data
│ ├── trad_data
| └── ...
└── dhgbench
│ ├── lib_dataset
│ ├── lib_models
| ├── lib_utils
│ ├── lib_yamls
│ ├── parameter_parser.py
└── └── ...
🚀 Quick Start
The following demonstrates show how to quickly run HGNN algorithm on the Cora dataset for the node classification task.
Step 1: Import Package
from dhgbench.parameter_parser import parameter_parser,method_config,set_task_args
from dhgbench.lib_utils.exp_agent import ExpAgent
from dhgbench.lib_models.HNN.preprocessing import algo_preprocessing
from dhgbench.lib_dataset.data_base import HyperDataset
from dhgbench.lib_dataset.preprocessing import data_processing
Step 2: Load and Set Up Configuration
args = parameter_parser()
args.dname, args.method, args.task_type, args.is_default = 'cora', 'HGNN', 'node_cls', False
args = method_config(args)
args = set_task_args(args)
Note that The is_default parameter indicates whether to use the model’s default configuration. If set to False, the model will instead load parameter settings specific to the given dataset. All model parameter files are provided in the lib_yamls directory.
Step 3: Load and Preprocess Dataset
data=HyperDataset(args)
if args.task_type == 'hg_cls':
data = data.multi_hypergraphs
else:
data = data_processing(args,data)
data._initialization_()
data = algo_preprocessing(data,args)
Step 4: Training and Evaluation
agent = ExpAgent(args)
agent.running(args.task_type,data)
⚙️ Configuration Argument Options
You can flexibly configure experiments with the following key parameters:
task_type
Specifies the type of task:
'node_cls', 'edge_pred', or 'hg_cls'
dname
Supported datasets include:
Node-level datasets:
'cora', 'pubmed', 'coauthor_cora','coauthor_dblp', 'ModelNet40', 'zoo', 'yelp', 'walmart-trips-100', 'trivago', 'actor','amazon', 'pokec', 'twitch', 'german', 'bail', 'credit'
Edge-level datasets:
'cora', 'pubmed', 'coauthor_cora', 'coauthor_dblp', 'actor', 'pokec'
Graph-level datasets:
'RHG_3', 'RHG_10', 'IMDB_dir_form', 'IMDB_dir_genre', 'stream_player', 'twitter_friend'
method
The algorithm to run. Supported algorithms include:
-
Spectral-based methods:
'HGNN','HyperGCN','HCHA','LEGCN','HyperND','HJRL','SheafHyperGNN','PhenomNN','DPHGNN','TFHNN' -
Spatial-based methods:
'HNHN', 'UniGCNII', 'AllSetformer', 'EDHNN', 'HyperGT' -
Tensor-based methods:
'EHNN', 'TMPHN'
You can also manually modify the configuration files located in lib_yamls directory for fine-grained control over hyperparameters.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dhg_bench-0.1.1.tar.gz.
File metadata
- Download URL: dhg_bench-0.1.1.tar.gz
- Upload date:
- Size: 86.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1986361227e1b314f4997fab39e3f404a69913035e1f77fe550801b65fde7ef2
|
|
| MD5 |
1182c752731528d1e8d749c90416ec3c
|
|
| BLAKE2b-256 |
43834679f3281c20410a4f6e50b99f402fb125b961f9231d436de41d1393ee28
|
File details
Details for the file dhg_bench-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dhg_bench-0.1.1-py3-none-any.whl
- Upload date:
- Size: 125.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acb1a994a45471f9584ce7402c6269ca88177656c4247fa5570db5a24b86eea3
|
|
| MD5 |
6be221ed797ad2bfac44c198d9a02236
|
|
| BLAKE2b-256 |
d19afa52ca33cd8aad506e5825528ea8dc9cd36a65b1371767c24f66de13218c
|