$ show BUPT-GAMMA/OpenHGNN
OpenHGNN is a comprehensive research framework for Heterogeneous Graph Neural Networks (HGNNs) built on PyTorch and DGL. The repository implements 83+ graph neural network models across 17+ tasks including node classification, link prediction, recommendation, knowledge graph completion, and temporal graph learning. It serves as a benchmarking platform for academic research, providing standardized implementations of state-of-the-art architectures like HGT, MAGNN, CompGCN, and HERO. The framework uses a registration pattern for dynamic model/trainer discovery and supports distributed training, hyperparameter optimization via Optuna, and GraphBolt integration for large-scale graphs. While it has CLI entry points and setup.py, its primary purpose is research reproducibility rather than production deployment. The codebase demonstrates strong architectural patterns with BaseDataset, BaseTask, and BaseFlow abstractions that enforce consistent interfaces across 50+ model implementations. However, significant technical debt exists including version mismatches (setup.py declares 0.7.0 while README claims 0.9.0), hardcoded dataset paths, mixed DGL/PyG usage, and monolithic configuration files. The repository contains extensive training artifacts in output/ directories and documentation drift between README, setup.py, and Sphinx docs. Despite these issues, it remains a valuable resource for graph learning researchers seeking reproducible implementations of heterogeneous GNN architectures.
The LLM identified 5 files worth highlighting for reuse:
Central adapter module that repurposes diverse datasets into standard Node Classification or Link Prediction formats with train/val/test masks. Implements graph adapter patterns that standardize heterogeneous graph structures across different datasets (ACM, DBLP, Yelp, etc.). Highly reusable as it solves the common data engineering problem of normalizing heterogeneous graph datasets for consistent model training. Could be extracted and applied to new graph datasets with minimal adaptation.
Centralized evaluation logic implementing standard graph learning metrics (F1 Macro/Micro, AUC, NDCG, Recall, Precision, MAE, KL Divergence). Solves the recurring data quality problem of consistent metric calculation across different models and tasks. Demonstrates non-obvious skill in handling heterogeneous graph evaluation scenarios. Could be extracted as a standalone evaluation library for any graph learning project.
Custom sampler modules (HGT_sampler, HAN_Sampler, HetGNN_sampler, NegativeSampler) that handle subgraph sampling for large-scale heterogeneous graphs using DGL's DataLoader. Implements non-obvious graph traversal logic for mini-batch training on massive graphs. Solves the critical scalability problem in graph neural networks. Could be extracted and applied to different graph datasets with minimal modification.
BaseFlow class enforces consistent training loop interfaces across 50+ trainer implementations. Implements early stopping, checkpoint management, and standardized train/evaluate patterns. Demonstrates strong architectural craftsmanship by decoupling model definitions from training logic. Another engineer could extract this pattern to create a new training framework with minimal modification.
BaseModel class with @register_model decorator enables dynamic model discovery and instantiation. Implements consistent forward pass signatures and parameter handling across 83+ model implementations. Demonstrates non-obvious skill in creating extensible model architecture. Could be extracted as a standalone model registry pattern for any deep learning framework.