This repository contains the implementation of Sheaf-enhanced Hypergraph Neural Networks
We recommend using Conda to manage the environment.
-
Create and activate a new environment:
conda create -n sheaf_env python=3.10 conda activate sheaf_env
-
Install dependencies: Ensure you have the
requirements.txtfile in the root directory.pip install -r requirements.txt
Note: Please ensure the directory structure is maintained for local imports (e.g.,
models,layers,helper,sheaf_builder.py,sheafRHNN_conv.py).
The datasets for link prediction tasks are pre-packaged in this repository under the data/ folder:
- FB-AUTO:
data/FB-AUTO - M-FB15K:
data/M-FB15K
For node classification tasks (e.g., Cora, PubMed, Citeseer), we utilize the preprocessing steps from the AllSet framework.
Setup Instructions: To generate datasets, please follow the instructions from the AllSet Repository. Once generated, place the
datafolder in the root directory of this project (e.g.,./data/).
This repository provides two main entry scripts.
Run the model for link prediction.
python run_inference.py \
-data data/FB-AUTO \
-score_func conve \
-opn corr \
-gpu 0 \
-epoch 5 \
-batch 256Run the model for node classification.
python run_classification.py \
--dname pubmed \
--method sheafHyperGNNDiag \
--cuda 0 \
--epochs 10 \
--heads 2 \
--MLP_hidden 32We provide Shell scripts to reproduce the experiments regarding dimension variations and noise robustness (SNR tests).
Prerequisite: Ensure the scripts are executable:
chmod +x *.sh-
Dimension Variation Test (Classification) Runs the classification model across different hidden dimensions (2, 4, ..., 128).
./run_dim_test.sh
-
Noise Robustness Test (Classification) Evaluates the model under Gaussian and Rayleigh noise with varying SNR (-6dB to 10dB).
./run_class_noise.sh
-
Noise Robustness Test (Inference) Evaluates the link prediction model under different noise conditions.
./run_infer_noise.sh
If you find this code useful for your research, please consider citing our work.