Skip to main content

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.

Metadata

Release files for dhg-bench 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dhg-bench 0.1.2
File Size Uploaded Provenance Actions
dhg_bench-0.1.2.tar.gz 86.4 kB Without provenance Details for dhg_bench-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dhg-bench 0.1.2
File Interpreter ABI Platform Actions
dhg_bench-0.1.2-py3-none-any.whl Python 3 none any Details for dhg_bench-0.1.2-py3-none-any.whl

Total release size: 212.2 kB

Release files / dhg_bench-0.1.2.tar.gz

Download URL dhg_bench-0.1.2.tar.gz
Size 86.4 kB
Tags Source
SHA-256 checksum
How to use checksums
47be7547b8d7c06780b141353d430c247e27fc1f476a01b5461c8e27ce506200
BLAKE2b-256 checksum
How to use checksums
ad763ee3ae84671e71ce24939046eaae8d2bd508282a146371b590f4726efd85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.21

Release files / dhg_bench-0.1.2-py3-none-any.whl

Download URL dhg_bench-0.1.2-py3-none-any.whl
Size 125.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73843f53584aa4b5c05fbbdd7fa24dd4a458c71cad1efaf365dd96bb267d2dd6
BLAKE2b-256 checksum
How to use checksums
0f2e84bffdea6793c4c85ccebb101fdb781d3635b8f1c2bc6e4a737e20b84ee2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.21

Security for dhg-bench 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page