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.
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
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.
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=truesource 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
source run_batch_sweeps.sh configs/expanded 2 25 0 "GeDi,AllSet,EDGNN" "texas,cornell"
Please for any question or clarification, contact the mail provided in the paper.
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}
}
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=trueRoman
↳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=trueChameleon
↳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=trueSquirrel
↳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=trueEmail-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=trueEmail-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=trueCora
↳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.0005Cornell
↳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=trueTexas
↳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=trueWisconsin
↳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=trueCiteseer
↳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.0005Amazon
↳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=trueDataset-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.0005Dataset-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.0005Synthetic 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=trueSynthetic 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=trueSynthetic 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