summaryrefslogtreecommitdiff
path: root/experiments/run_dblp_depth_scaling.py
diff options
context:
space:
mode:
authorYurenHao0426 <blackhao0426@gmail.com>2026-05-04 23:10:10 -0500
committerYurenHao0426 <blackhao0426@gmail.com>2026-05-04 23:10:10 -0500
commitba6ead6d7a41b7ed78bb228181b7262d0c75d2eb (patch)
tree726171fb4b0c536d9287a15daf52929ec65fa3d0 /experiments/run_dblp_depth_scaling.py
parent37ba0f83e3652a215680fd8515af9c14fc02e21c (diff)
Global rename GRAFT → KAFT (incl. internal class + filenames)
- src/trainers.py: GraphGrAPETrainer → KAFTTrainer; module docstring + comments. VanillaGrAPETrainer kept as-is (it is a separate control method, not KAFT). - experiments/: all 19 runners pick up the new class name; result keys ('Cora_GRAFT' etc) become 'Cora_KAFT'; OUT_DIRs renamed (e.g. bp_graft_depth_20seeds → bp_kaft_depth_20seeds). - figures/: data-lookup keys + display labels both 'KAFT'; output filename graft_depth_sweep.{pdf,png} → kaft_depth_sweep.{pdf,png}. - File rename: experiments/run_bp_graft_depth.py → run_bp_kaft_depth.py; figures/graft_depth_sweep.pdf → kaft_depth_sweep.pdf. - README aligned. Imports verified: from src.trainers import KAFTTrainer succeeds.
Diffstat (limited to 'experiments/run_dblp_depth_scaling.py')
-rw-r--r--experiments/run_dblp_depth_scaling.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/experiments/run_dblp_depth_scaling.py b/experiments/run_dblp_depth_scaling.py
index 4c0bc11..86a5af1 100644
--- a/experiments/run_dblp_depth_scaling.py
+++ b/experiments/run_dblp_depth_scaling.py
@@ -1,16 +1,16 @@
#!/usr/bin/env python3
"""E1: DBLP depth scaling — upgrade depth_stress 3-seed to 20 seeds on DBLP,
extend to L={8,12,16,20,24,32}. Goal: confirm (or falsify) the preliminary
-finding that GRAFT > ResGCN at L=16 (3-seed: 69.9 vs 63.7) and scales to L=32.
+finding that KAFT > ResGCN at L=16 (3-seed: 69.9 vs 63.7) and scales to L=32.
-BP vs ResGCN vs GRAFT vs GRAFT+ResGCN, GCN backbone, lr=0.01, 200 epochs."""
+BP vs ResGCN vs KAFT vs KAFT+ResGCN, GCN backbone, lr=0.01, 200 epochs."""
import torch
import numpy as np
import json
import os
from scipy import stats as scipy_stats
-from src.trainers import BPTrainer, GraphGrAPETrainer
+from src.trainers import BPTrainer, KAFTTrainer
from run_deep_baselines import ResGCNTrainer
from run_combo_20seeds import GRAFTResGCN
from run_dblp_depth import load_dblp
@@ -27,8 +27,8 @@ grape_extra = dict(diffusion_alpha=0.5, diffusion_iters=10,
METHODS = {
'BP': (BPTrainer, {}),
'ResGCN': (ResGCNTrainer, {}),
- 'GRAFT': (GraphGrAPETrainer, grape_extra),
- 'GRAFT+ResGCN': (GRAFTResGCN, grape_extra),
+ 'KAFT': (KAFTTrainer, grape_extra),
+ 'KAFT+ResGCN': (GRAFTResGCN, grape_extra),
}
@@ -100,11 +100,11 @@ def main():
'per_seed': vals.tolist()}
print(f" {mname:<15} {vals.mean():5.1f} ± {vals.std():4.1f}")
- # GRAFT vs ResGCN (paired)
+ # KAFT vs ResGCN (paired)
g_accs = np.array([per_seed_data[f"DBLP_L{L}_GRAFT"][str(s)] for s in SEEDS]) * 100
r_accs = np.array([per_seed_data[f"DBLP_L{L}_ResGCN"][str(s)] for s in SEEDS]) * 100
t_gr, p_gr = scipy_stats.ttest_rel(g_accs, r_accs)
- print(f" GRAFT vs ResGCN: Δ={g_accs.mean() - r_accs.mean():+.1f}, p={p_gr:.4f}")
+ print(f" KAFT vs ResGCN: Δ={g_accs.mean() - r_accs.mean():+.1f}, p={p_gr:.4f}")
with open(os.path.join(OUT_DIR, 'results.json'), 'w') as f:
json.dump(results, f, indent=2)