How snap-research/graphless-neural-networks works
Project type and purpose
• This is a machine-learning research codebase implementing “Graph-less Neural Networks” (GLNN).
• Purpose: Provide a distillation framework that trains graph-based teacher models (e.g., GCN, GraphSAGE) on graph datasets and then distills their knowledge into standard MLP student models to achieve fast inference with near-GNN accuracy.
• It is an open-source experimentation framework, not a web service or full-stack app.
File structure
• Top level
• data_preprocess.py – feature noise / preprocessing scripts
• dataloader.py – unified data-loading logic for OGB, CPF, BGNN, NonHom datasets
• models.py – defines Model class with teacher and student architectures (GCN, SAGE, MLP, etc.)
• train_teacher.py – script to train a teacher GNN
• train_student.py – script to train the student MLP via distillation (uses pretrained teacher outputs)
• train_and_eval.py – orchestrates full training and evaluation in one go
• prepare_env.sh + requirements.txt – environment setup (conda, dependencies)
• train.conf.yaml – configuration file for default hyperparameters
• utils.py – shared utilities (logging, checkpointing, metric computation)
• experiments/ – shell scripts for batch runs (ablation studies, dataset variations)
• LICENSE, README.md, .gitignore
• Patterns & architecture
• Modular ML pipeline: Data loading → preprocessing → teacher training → student distillation → evaluation
• Experiment orchestration separated into scripts under experiments/
• Config files (YAML) to decouple hyperparameters from code
README for additional insights
• Lists supported datasets and how they’re loaded (automatic download vs manual placement)
• Usage examples for train_teacher.py and train_student.py
• Emphasis on reproducibility via experiments/ scripts
Elements
• data flow (Data→Preprocess→Train)
• control flow (Experiment scripts triggering training scripts)
• artifact flow (Teacher checkpoint → Student input)
• Python scripts vs. config files vs. external libraries/services
• ML components vs. orchestration vs. environment setup