diff options
Diffstat (limited to 'figures')
| -rw-r--r-- | figures/gen_depth_sweep_fig.py | 20 | ||||
| -rw-r--r-- | figures/gen_fig4_combined.py | 12 | ||||
| -rw-r--r-- | figures/gen_realworld_depth_fig.py | 18 | ||||
| -rw-r--r-- | figures/kaft_depth_sweep.pdf (renamed from figures/graft_depth_sweep.pdf) | bin | 27139 -> 27139 bytes |
4 files changed, 25 insertions, 25 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):') diff --git a/figures/gen_fig4_combined.py b/figures/gen_fig4_combined.py index 5b8d464..1cdee10 100644 --- a/figures/gen_fig4_combined.py +++ b/figures/gen_fig4_combined.py @@ -3,7 +3,7 @@ Each panel: 9 curves = 3 datasets × 3 methods. color = dataset (Cora / CiteSeer / PubMed) - linestyle = method (BP dashed, DFA-GNN dotted, GRAFT solid) + linestyle = method (BP dashed, DFA-GNN dotted, KAFT solid) Matches DFA-GNN Figure 4 layout. """ @@ -15,18 +15,18 @@ from matplotlib.colors import to_rgba from matplotlib.lines import Line2D DATASETS = ['Cora', 'CiteSeer', 'PubMed'] -METHODS = ['BP', 'DFA-GNN', 'GRAFT'] # data-lookup keys (unchanged) -DISPLAY_NAME = {'BP': 'BP', 'DFA-GNN': 'DFA-GNN', 'GRAFT': 'KAFT'} +METHODS = ['BP', 'DFA-GNN', 'KAFT'] # data-lookup keys (unchanged) +DISPLAY_NAME = {'BP': 'BP', 'DFA-GNN': 'DFA-GNN', 'KAFT': 'KAFT'} DEPTHS = [4, 6, 8, 10, 12, 14, 16, 18, 20] RATES = [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8] ATTACKS = ['add', 'remove', 'flip'] -# Method colors — consistent with other GRAFT figures +# Method colors — consistent with other KAFT figures METHOD_COLORS = { 'BP': '#888888', # gray 'DFA-GNN': '#3B7AC2', # complementary blue - 'GRAFT': '#C23B3B', # brick red (ours) + 'KAFT': '#C23B3B', # brick red (ours) } # Dataset linestyles DS_STYLE = { @@ -48,7 +48,7 @@ DEPTH_SOURCES = [ 'results/combo_20seeds/per_seed_data.json', 'results/hero_extras_20seeds/per_seed_data.json', 'results/shallow_depth_20seeds/per_seed_data.json', - 'results/bp_graft_depth_20seeds/per_seed_data.json', + 'results/bp_kaft_depth_20seeds/per_seed_data.json', 'results/dfagnn_depth_20seeds/per_seed_data.json', 'results/dfagnn_resgcn_20seeds/per_seed_data.json', 'results/depth_extras_20seeds/per_seed_data.json', # L=14, 18 diff --git a/figures/gen_realworld_depth_fig.py b/figures/gen_realworld_depth_fig.py index 1ff7e2d..a9fb6d4 100644 --- a/figures/gen_realworld_depth_fig.py +++ b/figures/gen_realworld_depth_fig.py @@ -8,39 +8,39 @@ import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import to_rgba -# Aggregated paper-setup data: (mean, std) for BP and GRAFT at each depth +# Aggregated paper-setup data: (mean, std) for BP and KAFT at each depth DATA = { 'CFull-CiteSeer': { 'depths': [3, 5, 8, 10, 12, 14, 16, 18, 20], 'BP': [(0.870, 0.0072), (0.860, 0.0056), (0.825, 0.0208), (0.549, 0.1164), (0.365, 0.0209), (0.297, 0.0421), (0.230, 0.0209), (0.238, 0.0131), (0.209, 0.0319)], 'DFA': [(0.855, 0.0044), (0.834, 0.0106), (0.566, 0.0289), (0.425, 0.0993), (0.329, 0.1060), (0.368, 0.0604), (0.297, 0.0722), (0.243, 0.0661), (0.244, 0.0667)], 'DFA-GNN': [(0.858, 0.0038), (0.826, 0.0187), (0.581, 0.1085), (0.465, 0.0698), (0.289, 0.0677), (0.296, 0.1372), (0.244, 0.0673), (0.211, 0.0204), (0.193, 0.0051)], - 'GRAFT': [(0.857, 0.0006), (0.846, 0.0019), (0.829, 0.0021), (0.780, 0.0197), (0.667, 0.0630), (0.487, 0.0621), (0.430, 0.1145), (0.369, 0.0089), (0.380, 0.0258)], + 'KAFT': [(0.857, 0.0006), (0.846, 0.0019), (0.829, 0.0021), (0.780, 0.0197), (0.667, 0.0630), (0.487, 0.0621), (0.430, 0.1145), (0.369, 0.0089), (0.380, 0.0258)], }, 'CFull-DBLP': { 'depths': [3, 5, 8, 10, 12, 14, 16, 18, 20], 'BP': [(0.826, 0.0027), (0.814, 0.0006), (0.793, 0.0070), (0.710, 0.1180), (0.652, 0.0728), (0.559, 0.1132), (0.454, 0.0065), (0.469, 0.0077), (0.461, 0.0144)], 'DFA': [(0.829, 0.0031), (0.819, 0.0076), (0.736, 0.0409), (0.703, 0.0025), (0.682, 0.0257), (0.548, 0.1104), (0.532, 0.1206), (0.533, 0.1209), (0.447, 0.0000)], 'DFA-GNN': [(0.832, 0.0024), (0.823, 0.0033), (0.766, 0.0362), (0.617, 0.1203), (0.617, 0.1203), (0.523, 0.1018), (0.447, 0.0000), (0.447, 0.0000), (0.531, 0.1187)], - 'GRAFT': [(0.827, 0.0024), (0.825, 0.0090), (0.813, 0.0121), (0.786, 0.0032), (0.730, 0.0315), (0.701, 0.0020), (0.700, 0.0001), (0.610, 0.1150), (0.613, 0.1175)], + 'KAFT': [(0.827, 0.0024), (0.825, 0.0090), (0.813, 0.0121), (0.786, 0.0032), (0.730, 0.0315), (0.701, 0.0020), (0.700, 0.0001), (0.610, 0.1150), (0.613, 0.1175)], }, 'CFull-PubMed (biomed)': { 'depths': [3, 5, 8, 10, 12, 14, 16, 18, 20], 'BP': [(0.845, 0.0018), (0.833, 0.0023), (0.825, 0.0026), (0.824, 0.0025), (0.699, 0.0096), (0.499, 0.1413), (0.399, 0.0000), (0.500, 0.1421), (0.399, 0.0000)], 'DFA': [(0.822, 0.0041), (0.793, 0.0188), (0.585, 0.1353), (0.531, 0.0768), (0.484, 0.0833), (0.431, 0.0446), (0.427, 0.0383), (0.399, 0.0000), (0.399, 0.0000)], 'DFA-GNN': [(0.822, 0.0040), (0.750, 0.0551), (0.604, 0.1572), (0.522, 0.1154), (0.462, 0.0888), (0.399, 0.0000), (0.438, 0.0550), (0.399, 0.0000), (0.466, 0.0945)], - 'GRAFT': [(0.830, 0.0068), (0.814, 0.0049), (0.789, 0.0099), (0.732, 0.0713), (0.690, 0.0585), (0.646, 0.0134), (0.603, 0.0086), (0.545, 0.1031), (0.525, 0.0887)], + 'KAFT': [(0.830, 0.0068), (0.814, 0.0049), (0.789, 0.0099), (0.732, 0.0713), (0.690, 0.0585), (0.646, 0.0134), (0.603, 0.0086), (0.545, 0.1031), (0.525, 0.0887)], }, 'Coauthor-Physics': { 'depths': [3, 5, 8, 10, 12, 14, 16, 18, 20], 'BP': [(0.949, 0.0005), (0.943, 0.0014), (0.937, 0.0011), (0.829, 0.0344), (0.818, 0.0387), (0.770, 0.0151), (0.743, 0.0038), (0.682, 0.1000), (0.521, 0.0215)], 'DFA': [(0.948, 0.0007), (0.920, 0.0067), (0.711, 0.0227), (0.686, 0.1275), (0.560, 0.0751), (0.506, 0.0005), (0.557, 0.0737), (0.559, 0.0762), (0.505, 0.0000)], 'DFA-GNN': [(0.947, 0.0012), (0.836, 0.0451), (0.712, 0.0369), (0.567, 0.0720), (0.505, 0.0003), (0.505, 0.0000), (0.505, 0.0000), (0.559, 0.0756), (0.505, 0.0000)], - 'GRAFT': [(0.947, 0.0008), (0.943, 0.0004), (0.922, 0.0092), (0.867, 0.0368), (0.749, 0.0423), (0.686, 0.0122), (0.614, 0.0771), (0.666, 0.0010), (0.667, 0.0003)], + 'KAFT': [(0.947, 0.0008), (0.943, 0.0004), (0.922, 0.0092), (0.867, 0.0368), (0.749, 0.0423), (0.686, 0.0122), (0.614, 0.0771), (0.666, 0.0010), (0.667, 0.0003)], }, } -COLORS = {'BP': '#888888', 'DFA': '#7A5BAA', 'DFA-GNN': '#3B7AC2', 'GRAFT': '#C23B3B'} +COLORS = {'BP': '#888888', 'DFA': '#7A5BAA', 'DFA-GNN': '#3B7AC2', 'KAFT': '#C23B3B'} GRID = '#ECEFF3' TEXT = '#2F3437' @@ -57,7 +57,7 @@ legend_handles = {} for ax, ds in zip(axes, datasets): d = DATA[ds] xs = d['depths'] - for method in ['BP', 'DFA', 'DFA-GNN', 'GRAFT']: + for method in ['BP', 'DFA', 'DFA-GNN', 'KAFT']: means = np.array([v[0] for v in d[method]]) stds = np.array([v[1] for v in d[method]]) c = COLORS[method] @@ -81,9 +81,9 @@ for ax, ds in zip(axes, datasets): axes[0].set_ylabel('Test accuracy', fontsize=9, color=TEXT) -handles = [legend_handles[m] for m in ['BP', 'DFA', 'DFA-GNN', 'GRAFT']] +handles = [legend_handles[m] for m in ['BP', 'DFA', 'DFA-GNN', 'KAFT']] fig.tight_layout(rect=(0.0, 0.06, 1.0, 1.0), w_pad=1.5) -# Display label: GRAFT data key stays for the lookup, render as KAFT +# Display label: KAFT data key stays for the lookup, render as KAFT fig.legend(handles, ['BP', 'DFA', 'DFA-GNN', 'KAFT'], frameon=False, loc='lower center', ncol=4, bbox_to_anchor=(0.5, -0.005), handletextpad=0.6, columnspacing=1.8) diff --git a/figures/graft_depth_sweep.pdf b/figures/kaft_depth_sweep.pdf Binary files differindex 21b06f2..21b06f2 100644 --- a/figures/graft_depth_sweep.pdf +++ b/figures/kaft_depth_sweep.pdf |
