How imoonlab/dhgformer works
DHGFormer is a brain-disorder diagnosis research application. Its documented run loads prepared ABIDE data, builds a dynamic hierarchical graph-transformer, and trains and evaluates it; the repository also includes ABIDE preprocessing and graph-data utilities. The graph follows only relationships visible in the excerpts, SOURCE INDEX, or README. Several model and preprocessing details are unsampled, so their internal relationships are omitted where not evidenced.
Main entry points: train.py Train and evaluate · main.py Run configuration · DHGFormer.py DHGFormer · 01-fetch_data.py Fetch ABIDE
Components 20
ABIDE data
- Fetch ABIDE
util/abide/01-fetch_data.py - Process ABIDE
util/abide/02-process_data.py - Generate dataset
util/abide/03-generate_abide_dataset.py - Connectivity preprocessing
imports/preprocess_data.py - ABIDE dataset reader
imports/ABIDEDataset.py - Parallel graph reader
imports/read_abide_stats_parall.py - Graph diffusion
imports/gdc.py
Training runtime
- Data loader
dataloader.py - Run configuration
main.py - Train and evaluate
train.py
Graph model
- DHGFormer
model/DHGFormer.py - FC transformer encoder
model/Encoder.py - Learnable graph generator
model/DHGFormer.py - Hierarchical prediction
model/DHGFormer.py
Training support
- Mixup preprocessing
util/prepossess.py - Training losses
util/loss.py - Metrics and meters
util/meter.py - Logging
util/logger.py
Other components
- Researcher
- ABIDE download
Connections 21
- ABIDE download → Fetch ABIDE: provides data
README.md - Fetch ABIDE → Process ABIDE: prepares files
- Process ABIDE → Generate dataset: builds dataset
- Fetch ABIDE → Connectivity preprocessing: uses preprocessing
util/abide/01-fetch_data.py - Process ABIDE → Connectivity preprocessing: uses preprocessing
util/abide/02-process_data.py - ABIDE dataset reader → Parallel graph reader: reads graph data
imports/ABIDEDataset.py - Parallel graph reader → Graph diffusion: applies diffusion
imports/read_abide_stats_parall.py - Researcher → Run configuration: starts training
README.md - Run configuration → Data loader: initializes data
main.py - Run configuration → DHGFormer: constructs model
main.py - Run configuration → Train and evaluate: starts training
main.py - Data loader → Train and evaluate: supplies batches
main.py - Train and evaluate → DHGFormer: runs forward pass
train.py - DHGFormer → FC transformer encoder: encodes time series
model/DHGFormer.py - DHGFormer → Learnable graph generator: generates graph
model/DHGFormer.py - DHGFormer → Hierarchical prediction: predicts from graph
model/DHGFormer.py - Train and evaluate → Mixup preprocessing: mixes training batches
train.py - Train and evaluate → Training losses: computes auxiliary loss
train.py - Train and evaluate → Metrics and meters: updates metrics
- Train and evaluate → Logging: logs progress
- Run configuration → Logging: logs run
main.py