Skip to main content

HyperTorch

Repo Forks Stargazers Contributors Issues
Package License: MIT Python Documentation
Testing Daily CI codecov CodeFactor
Contact Discord

About the project

HyperTorch is a library for hypergraph learning and benchmarking. It provides a standardized workflow for loading hypergraph datasets, training models, evaluating them under comparable settings, and reporting results. The current release focuses on Hyperlink Prediction, with ready-to-run pipelines for established hypergraph baselines.

The library is built around extensibility: datasets are represented in HIF format and converted into typed tensor objects, models can be implemented as standard Lightning modules, and benchmarking is handled through reusable trainers, samplers, metrics, loggers, and result exporters (Markdown/LaTeX). HyperTorch includes preloaded datasets, mini-batch and full-hypergraph data loading, negative sampling utilities, structural feature enrichers, neural components, and built-in models such as HGNN, HNHN, HyperGCN, GCN, MLP/SLP, NHP, Node2Vec, VilLain, and more.

Use HyperTorch to:

  • Benchmark existing models across a shared collection of hypergraph datasets.
  • Develop custom PyTorch or PyTorch Lightning models and train and compare them against the built-in baselines.
  • Integrate new datasets through the HIF format and run the same training, evaluation, and reporting pipeline on them.

Table of contents

Main features

Feature What you can do Highlights Location
Dataset management Load, process, and validate hypergraph datasets HIF loader/processor, built-in datasets such as Algebra, Cora, Pubmed, DBLP, Amazon, and IMDB hypertorch.data
Splitting, sampling, and batching Prepare train/validation/test data and mini-batches Dataset splitters, node and hyperedge samplers, negative samplers, data loaders hypertorch.data
Feature enrichment Enrich node and hyperedge features before training Laplacian positional encodings, Node2Vec features, hyperedge weights and attributes hypertorch.data
Models Access hypergraph models HGNN, HGNNP, HNHN, HyperGCN, GCN, MLP/SLP, NHP, Node2Vec, VilLain, CommonNeighbors hypertorch.models
Neural components Build models and pipelines Layers, aggregators, losses, and activation/normalization helpers hypertorch.nn
HLP pipelines Use ready-to-train hyperlink prediction modules HLP modules with encoders, configs, losses, and stage metrics for multiple models hypertorch.hlp
Training and benchmarking Train, compare, checkpoint, and report model runs Multi-model trainer, schedulers, TensorBoard support, CSV/Markdown/LaTeX result tables hypertorch.train

Getting started

For users working with the pip package manager, HyperTorch can be installed from PyPI.

pip install hypertorch

# if you want to install optional dependencies for tensorboard support:
pip install "hypertorch[tensorboard]"

or alternatively, using uv:

uv add hypertorch # or uv pip install hypertorch

# for optional dependencies for tensorboard support:
uv add "hypertorch[tensorboard]"

If you want to build the project from source, see the documentation for more details.

Run examples

You can download the examples directory and run the example scripts to get started.

With Python:

python3 examples/hyperlink_prediction/nhp.py

Or with uv:

uv run examples/hyperlink_prediction/nhp.py

Contributing

See CONTRIBUTING.md for details on contributing to the project.

Documentation

You can find the extensive documentation here.

Alternatively, you can build the documentation locally with the following commands:

make docs

# With explicit commands
uv run zensical build --clean -f zensical.toml
uv run zensical serve -f zensical.toml -a 127.0.0.1:8000

and open the browser at http://localhost:8000 to access the documentation.

License

See LICENSE.

Discussion

Most development discussions take place on GitHub in this repo, via the GitHub issue tracker.

Alt

Star History Chart

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hypertorch-0.1.7.tar.gz (148.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hypertorch-0.1.7-py3-none-any.whl (199.0 kB view details)

Uploaded Python 3

File details

Details for the file hypertorch-0.1.7.tar.gz.

File metadata

  • Download URL: hypertorch-0.1.7.tar.gz
  • Upload date:
  • Size: 148.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hypertorch-0.1.7.tar.gz
Algorithm Hash digest
SHA256 dbcbfad211a82d0e365f7439d12d01c8fbad19003f0de125e680cb794a18ad6c
MD5 27da87eae2df7ef22a9ff6f80e421a77
BLAKE2b-256 53ddf874d95b98d2d00bf91da8bbb934e4b092b44850c2feb07b3e5616712a11

See more details on using hashes here.

Provenance

The following attestation bundles were made for hypertorch-0.1.7.tar.gz:

Publisher: release.yaml on hypernetwork-research-group/hypertorch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hypertorch-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: hypertorch-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 199.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hypertorch-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b0f82f82d3cb06c1c6a095ed8bbeab975d8b352762e559bdb6efca63738f6c7b
MD5 b292cb2bf50e355f28e7e6cbdbb5e4e8
BLAKE2b-256 fd42bb236b3b1b0afb8b6269a53609beb696970622be18f422f9db586ec781b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for hypertorch-0.1.7-py3-none-any.whl:

Publisher: release.yaml on hypernetwork-research-group/hypertorch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

This release

0.1.7 This release

2 files

0.1.6

2 files

0.1.1

2 files

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