Skip to content

Repository files navigation

Directional Sheaf Hypergraph Networks: Unifying Learning on Directed and Undirected Hypergraphs

This repository contains the official PyTorch implementation of "Directional Sheaf Hypergraph Networks: Unifying Learning on Directed and Undirected Hypergraphs", accepted at ICLR 2026, including both its code and the code for running other Hypergraph Neural Networks.

Environment Setup

To install the conda environment run the following script:

source ~/miniconda3/etc/profile.d/conda.sh
conda env create -f env.yaml
conda activate DirectionalSheafHypergraphs
pip install -r requirements.txt

How to run

To run either DSHN or DSHNLight, set --method=SheafGeDiDiag while executing the main.py file. To enable DSHNLight, additionally specify the --light=true flag; otherwise, the DSHN model is used by default.

Example

python main.py --AllSet_input_norm=false --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=64 --d=6 --directed=true --dname=telegram --dropout=0.2 --dynamic_sheaf=true --early_stopping=200 --epochs=500 --lr=0.001 --method=SheafGeDiDiag --q=0.25 --residual=false --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=4 --sheaf_pred_block=MLP_var3 --sheaf_special_head=false --wd=5e-4 --add_identity=true

Run a batched sweep

source run_batch_sweeps.sh configs/expanded {number_of_agents} {max_number_runs_per_agent} {cuda_device} {list_methods} {list_datasets}

The methods should be called like the corresponding yaml file.

Datasets to specify to the sweeps
  • telegram
  • amazon
  • roman
  • cornell
  • chameleon
  • squirrel
  • cora
  • citeseer
  • wisconsin
  • texas
  • EU
  • enroll
  • node_500_subset-min-3_subset-max-10_N-intra-30_N-inter-10
  • node_500_subset-min-3_subset-max-10_N-intra-30_N-inter-30
  • node_500_subset-min-3_subset-max-10_N-intra-30_N-inter-50
  • Dataset-1
  • Dataset-2
  • Dataset-3
Models to specify to the sweeps
  • DHMConv (with feat)
  • DHMConvnofeat (without feat)
  • DHGNN (with feat)
  • DHGNNnofeat (without feat)
  • AllDeepSets
  • AllSet
  • EDGNN
  • GeDi
  • GeDinodir
  • HCHA
  • HGNN
  • HNHN
  • HyperGCN
  • HyperND
  • LEGCN
  • PhenomNN
  • SheafGeDiDiag
  • SheafGeDiDiagLight
  • SheafHyperGNNDiag
  • SheafHyperGNNDiagLight
  • UniGNNII

Example

source run_batch_sweeps.sh configs/expanded 2 25 0 "GeDi,AllSet,EDGNN" "texas,cornell"

Contact

Please for any question or clarification, contact the mail provided in the paper.

Citation

If you use this work in your research, please cite:

@misc{mule2025directionalsheafhypergraphnetworks,
  title        = {Directional Sheaf Hypergraph Networks: Unifying Learning on Directed and Undirected Hypergraphs},
  author       = {Mule, Emanuele and Fiorini, Stefano and Purificato, Antonio and Siciliano, Federico and Coniglio, Stefano and Silvestri, Fabrizio},
  year         = {2025},
  eprint       = {2510.04727},
  archivePrefix= {arXiv},
  primaryClass = {cs.LG},
  url          = {https://arxiv.org/abs/2510.04727}
}

Best Configurations

Telegram
  ↳DSHN
main.py --AllSet_input_norm=false --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=64 --d=6 --directed=true --dname=telegram --dropout=0.2 --dynamic_sheaf=true --early_stopping=200 --epochs=500 --lr=0.001 --method=SheafGeDiDiag --q=0.25 --residual=false --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=4 --sheaf_pred_block=MLP_var3 --sheaf_special_head=false --wd=5e-4 --add_identity=true
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=32 --Classifier_num_layers=2 --MLP_hidden=512 --d=4 --directed=true --dname=telegram --dropout=0 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.02 --method=SheafGeDiDiag --q=0.25 --residual=false --sheaf_act=sigmoid --sheaf_dropout=true --sheaf_left_proj=false --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=false --wd=0 --add_identity=true
Roman
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=256 --Classifier_num_layers=2 --MLP_hidden=32 --d=1 --directed=true --dname=roman --dropout=0.1 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.01 --method=SheafGeDiDiag --q=0.15 --residual=true --runs=10 --sheaf_act=relu --sheaf_dropout=true --sheaf_left_proj=true --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005 --add_identity=true
Chameleon
  ↳DSHN
main.py --AllSet_input_norm=true --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=256 --d=3 --directed=true --dname=chameleon --dropout=0.1 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.02 --method=SheafGeDiDiag --q=0.15 --residual=true --runs=10 --sheaf_act=relu --sheaf_dropout=false --sheaf_left_proj=false --sheaf_num_layers=4 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0 --add_identity=true
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=512 --d=5 --directed=true --dname=chameleon --dropout=0 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.01 --method=SheafGeDiDiag --q=0.05 --residual=true --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=5e-05 --add_identity=true
Squirrel
  ↳DSHN
main.py --AllSet_input_norm=false --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=64 --d=4 --directed=true --dname=squirrel --dropout=0.5 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.005 --method=SheafGeDiDiag --q=0.2 --residual=true --runs=10 --sheaf_act=relu --sheaf_dropout=false --sheaf_left_proj=false --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005 --add_identity=true
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=32 --Classifier_num_layers=2 --MLP_hidden=64 --d=6 --directed=true --dname=squirrel --dropout=0.4 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.02 --method=SheafGeDiDiag --q=0 --residual=false --runs=10 --sheaf_act=relu --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=4 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=5e-05 --add_identity=true
Email-Enron
  ↳DSHN
main.py --AllSet_input_norm=true --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=32 --d=1 --directed=true --dname=enroll --dropout=0 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.01 --method=SheafGeDiDiag --q=0.05 --residual=false --runs=10 --sheaf_act=none --sheaf_dropout=false --sheaf_left_proj=false --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=5e-4
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=32 --Classifier_num_layers=2 --MLP_hidden=64 --d=2 --directed=true --dname=enroll --dropout=0 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.005 --method=SheafGeDiDiag --q=0.05 --residual=false --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=5e-05 --add_identity=true
Email-EU
  ↳DSHN
main.py --AllSet_input_norm=true --Classifier_hidden=32 --Classifier_num_layers=2 --MLP_hidden=512 --d=1 --directed=true --dname=EU --dropout=0.3 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.001 --method=SheafGeDiDiag --q=0.25 --residual=false --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=false --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0 --add_identity=true
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=32 --Classifier_num_layers=2 --MLP_hidden=256 --d=1 --directed=true --dname=EU --dropout=0 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.001 --method=SheafGeDiDiag --q=0.25 --residual=false --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=4 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=5e-5 --add_identity=true
Cora
  ↳DSHN
main.py --AllSet_input_norm=false --Classifier_hidden=256 --Classifier_num_layers=2 --MLP_hidden=256 --add_identity=true --d=2 --directed=true --dname=cora --dropout=0.3 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.001 --method=SheafGeDiDiag --q=0 --residual=true --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=false --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005
  ↳DSHNLight
main.py --AllSet_input_norm=false --Classifier_hidden=256 --Classifier_num_layers=2 --MLP_hidden=256 --add_identity=true --d=2 --directed=true --dname=cora --dropout=0.3 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.001 --method=SheafGeDiDiag --q=0 --residual=true --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=false --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005
Cornell
  ↳DSHN
main.py --AllSet_input_norm=true --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=256 --d=6 --directed=true --dname=cornell --dropout=0.9 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.005 --method=SheafGeDiDiag --q=0.25 --residual=true --runs=10 --sheaf_act=relu --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=1 --sheaf_pred_block=MLP_var3 --sheaf_special_head=false --wd=0.0005 --add_identity=true
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=32 --Classifier_num_layers=2 --MLP_hidden=32 --d=4 --directed=true --dname=cornell --dropout=0.7 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.01 --method=SheafGeDiDiag --q=0.25 --residual=true --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=2 --sheaf_pred_block=MLP_var3 --sheaf_special_head=false --wd=0.0005 --add_identity=true
Texas
  ↳DSHN
main.py --AllSet_input_norm=true --Classifier_hidden=128 --Classifier_num_layers=2 --MLP_hidden=128 --d=6 --directed=true --dname=texas --dropout=0.3 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.01 --method=SheafGeDiDiag --q=0.2 --residual=true --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=2 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005 --add_identity=true
  ↳DSHNLight
main.py --AllSet_input_norm=false --Classifier_hidden=128 --Classifier_num_layers=2 --MLP_hidden=64 --d=4 --directed=true --dname=texas --dropout=0.5 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.02 --method=SheafGeDiDiag --q=0.2 --residual=true --runs=10 --sheaf_act=relu --sheaf_dropout=true --sheaf_left_proj=false --sheaf_num_layers=2 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005 --add_identity=true
Wisconsin
  ↳DSHN
main.py --AllSet_input_norm=true --Classifier_hidden=128 --Classifier_num_layers=2 --MLP_hidden=256 --d=4 --directed=true --dname=wisconsin --dropout=0.8 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.02 --method=SheafGeDiDiag --q=0.05 --residual=true --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=1 --sheaf_pred_block=MLP_var3 --sheaf_special_head=false --wd=0.0005 --add_identity=true
  ↳DSHNLight
main.py --AllSet_input_norm=false --Classifier_hidden=128 --Classifier_num_layers=2 --MLP_hidden=512 --d=5 --directed=true --dname=wisconsin --dropout=0.9 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.005 --method=SheafGeDiDiag --q=0.05 --residual=true --runs=10 --sheaf_act=tanh --sheaf_dropout=true --sheaf_left_proj=false --sheaf_num_layers=1 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005 --add_identity=true
Citeseer
  ↳DSHN
main.py --AllSet_input_norm=false --Classifier_hidden=128 --Classifier_num_layers=2 --MLP_hidden=256 --add_identity=false --d=5 --directed=true --dname=citeseer --dropout=0.7 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.001 --method=SheafGeDiDiag --q=0.05 --residual=true --runs=10 --sheaf_act=relu --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=3 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005
  ↳DSHNLight
main.py --AllSet_input_norm=false --Classifier_hidden=128 --Classifier_num_layers=2 --MLP_hidden=256 --add_identity=true --d=6 --directed=true --dname=citeseer --dropout=0.8 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.001 --method=SheafGeDiDiag --q=0.1 --residual=true --runs=10 --sheaf_act=none --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=3 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005
Amazon
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=32 --Classifier_num_layers=2 --MLP_hidden=256 --d=6 --directed=true --dname=amazon --dropout=0.4 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.02 --method=SheafGeDiDiag --q=0 --residual=true --runs=10 --sheaf_act=relu --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=3 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0 --add_identity=true
Dataset-1
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=128 --d=1 --directed=true --dname=Dataset-2 --dropout=0 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.001 --method=SheafGeDiDiag --q=0 --residual=false --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=3 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005
Dataset-2
  ↳DSHN
main.py --AllSet_input_norm=true --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=128 --d=1 --directed=true --dname=Dataset-2 --dropout=0 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.001 --method=SheafGeDiDiag --q=0 --residual=false --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=3 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=128 --d=1 --directed=true --dname=Dataset-2 --dropout=0 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.001 --method=SheafGeDiDiag --q=0 --residual=false --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=3 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005
Synthetic 1
  ↳DSHN
main.py --AllSet_input_norm=true --Classifier_hidden=32 --Classifier_num_layers=2 --MLP_hidden=256 --d=5 --directed=true --dname=node:500_subset-min=3_subset-max=10_N-intra=30_N-inter=10 --dropout=0 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.005 --method=SheafGeDiDiag --q=0.25 --residual=true --runs=10 --sheaf_act=sigmoid --sheaf_dropout=true --sheaf_left_proj=true --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005 --add_identity=true
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=32 --Classifier_num_layers=2 --MLP_hidden=64 --d=3 --directed=true --dname=node:500_subset-min=3_subset-max=10_N-intra=30_N-inter=10 --dropout=0.4 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.01 --method=SheafGeDiDiag --q=0.25 --residual=true --runs=10 --sheaf_act=sigmoid --sheaf_dropout=false --sheaf_left_proj=false --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=0.0005 --add_identity=true
Synthetic 2
  ↳DSHN
main.py --AllSet_input_norm=true --Classifier_hidden=128 --Classifier_num_layers=2 --MLP_hidden=128 --d=5 --directed=true --dname=node:500_subset-min=3_subset-max=10_N-intra=30_N-inter=30 --dropout=0.1 --dynamic_sheaf=true --early_stopping=200 --epochs=500 --lr=0.005 --method=SheafGeDiDiag --q=0.1 --residual=false --runs=10 --sheaf_act=sigmoid --sheaf_dropout=true --sheaf_left_proj=true --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=false --wd=5e-4 --add_identity=true
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=32 --Classifier_num_layers=2 --MLP_hidden=256 --d=4 --directed=true --dname=node:500_subset-min=3_subset-max=10_N-intra=30_N-inter=30 --dropout=0.2 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --light=true --lr=0.001 --method=SheafGeDiDiag --q=0.2 --residual=false --runs=10 --sheaf_act=none --sheaf_dropout=false --sheaf_left_proj=true --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=true --wd=5e-05 --add_identity=true
Synthetic 3
  ↳DSHN
main.py --AllSet_input_norm=true --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=32 --d=6 --directed=true --dname=node:500_subset-min=3_subset-max=10_N-intra=30_N-inter=50 --dropout=0.3 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.01 --method=SheafGeDiDiag --q=0.25 --residual=false --runs=10 --sheaf_act=tanh --sheaf_dropout=true --sheaf_left_proj=false --sheaf_num_layers=4 --sheaf_pred_block=MLP_var3 --sheaf_special_head=false --wd=0.0005 --add_identity=true
  ↳DSHNLight
main.py --AllSet_input_norm=true --Classifier_hidden=64 --Classifier_num_layers=2 --MLP_hidden=64 --d=4 --directed=true --dname=node:500_subset-min=3_subset-max=10_N-intra=30_N-inter=50 --dropout=0.2 --dynamic_sheaf=false --early_stopping=200 --epochs=500 --lr=0.01 --method=SheafGeDiDiag --q=0.25 --residual=false --runs=10 --sheaf_act=tanh --sheaf_dropout=true --sheaf_left_proj=true --sheaf_num_layers=5 --sheaf_pred_block=MLP_var3 --sheaf_special_head=false --wd=0.0005 --add_identity=true

About

Directional Sheaf Hypergraph Networks: Unifying Learning on Directed and Undirected Hypergraphs (ICLR 2026)

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages