diff options
| author | YurenHao0426 <blackhao0426@gmail.com> | 2026-05-04 23:10:10 -0500 |
|---|---|---|
| committer | YurenHao0426 <blackhao0426@gmail.com> | 2026-05-04 23:10:10 -0500 |
| commit | ba6ead6d7a41b7ed78bb228181b7262d0c75d2eb (patch) | |
| tree | 726171fb4b0c536d9287a15daf52929ec65fa3d0 /figures/gen_depth_sweep_fig.py | |
| parent | 37ba0f83e3652a215680fd8515af9c14fc02e21c (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 'figures/gen_depth_sweep_fig.py')
| -rw-r--r-- | figures/gen_depth_sweep_fig.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/figures/gen_depth_sweep_fig.py b/figures/gen_depth_sweep_fig.py index 9604a6a..0d4da61 100644 --- a/figures/gen_depth_sweep_fig.py +++ b/figures/gen_depth_sweep_fig.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """H8: Generate Figure 4(a)-style depth sweep plot. -4 panels (Cora/CiteSeer/PubMed/DBLP), 3 curves per panel (BP/DFA-GNN/GRAFT). +4 panels (Cora/CiteSeer/PubMed/DBLP), 3 curves per panel (BP/DFA-GNN/KAFT). x = number of layers L; y = test accuracy (%) with shaded std band. Method distinguished by color only (per memory `feedback_viz_shape`: @@ -14,10 +14,10 @@ import matplotlib.pyplot as plt from matplotlib.colors import to_rgba DATASETS = ['Cora', 'CiteSeer', 'PubMed', 'DBLP'] -METHODS = ['BP', 'DFA-GNN', 'GRAFT'] +METHODS = ['BP', 'DFA-GNN', 'KAFT'] # Per-dataset depth grids — DBLP extends to 24, 32 from dblp_depth_scaling. # Other datasets cover 2..20. Missing entries (e.g. DFA-GNN at L=2/3, DBLP L=10 -# for BP/GRAFT) will be silently skipped by lookup(). +# for BP/KAFT) will be silently skipped by lookup(). DEPTHS_DEFAULT = [2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20] DEPTHS_DBLP = [2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 24, 32] DEPTHS_BY_DS = {ds: (DEPTHS_DBLP if ds == 'DBLP' else DEPTHS_DEFAULT) @@ -25,21 +25,21 @@ DEPTHS_BY_DS = {ds: (DEPTHS_DBLP if ds == 'DBLP' else DEPTHS_DEFAULT) # All result files we might need to consult SOURCES = [ - 'results/combo_20seeds/per_seed_data.json', # L=6 BP/GRAFT/stacks on Cora/CS/DBLP + 'results/combo_20seeds/per_seed_data.json', # L=6 BP/KAFT/stacks on Cora/CS/DBLP 'results/hero_extras_20seeds/per_seed_data.json', # L=6 on PubMed + Coauthor 'results/shallow_depth_20seeds/per_seed_data.json', # L=2,3,4 on 4ds 'results/dblp_depth_scaling_20seeds/per_seed_data.json', # DBLP L=8-32 - 'results/bp_graft_depth_20seeds/per_seed_data.json', # Cora/CS/PubMed L=8-20 + 'results/bp_kaft_depth_20seeds/per_seed_data.json', # Cora/CS/PubMed L=8-20 'results/dfagnn_depth_20seeds/per_seed_data.json', # DFA-GNN at all depths 'results/dfagnn_resgcn_20seeds/per_seed_data.json', # DFA-GNN L=6 Cora/CS/DBLP 'results/depth_extras_20seeds/per_seed_data.json', # L=14, L=18 × 4ds × 3 methods ] -# Colors — GRAFT brick red (main method), BP gray, DFA-GNN complementary blue +# Colors — KAFT brick red (main method), BP gray, DFA-GNN complementary blue COLORS = { 'BP': '#888888', # reference gray 'DFA-GNN': '#3B7AC2', # complementary blue - 'GRAFT': '#C23B3B', # brick red (our method) + 'KAFT': '#C23B3B', # brick red (our method) } GRID_COLOR = '#ECEFF3' @@ -143,10 +143,10 @@ def main(): frameon=False, loc='lower center', ncol=len(labels), bbox_to_anchor=(0.5, -0.005), handletextpad=0.6, columnspacing=1.8) - fig.savefig('/home/yurenh2/graph-grape/graft_depth_sweep.png', dpi=300, bbox_inches='tight') - fig.savefig('/home/yurenh2/graph-grape/graft_depth_sweep.pdf', bbox_inches='tight') + fig.savefig('/home/yurenh2/graph-grape/kaft_depth_sweep.png', dpi=300, bbox_inches='tight') + fig.savefig('/home/yurenh2/graph-grape/kaft_depth_sweep.pdf', bbox_inches='tight') plt.close(fig) - print('Saved /home/yurenh2/graph-grape/graft_depth_sweep.{png,pdf}') + print('Saved /home/yurenh2/graph-grape/kaft_depth_sweep.{png,pdf}') # Data dump print('\nData (mean ± std):') |
