Skip to content

Commit e025979

Browse files
committed
update ablation
1 parent 25bb76d commit e025979

File tree

9 files changed

+12853
-481
lines changed

9 files changed

+12853
-481
lines changed

plot_figures/loss/plot_lrscaler_ablation.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
66

77
import matplotlib.pyplot as plt
8-
import pandas as pd
98
import numpy as np
10-
9+
import pandas as pd
1110
from utils import (
12-
LIGHT_COLORS,
13-
lighten_color,
11+
ABLATION_COLORS,
1412
save_figure,
1513
set_axis_limits,
1614
set_legend_style,
@@ -36,25 +34,25 @@
3634
# Spectral MuP 作为baseline(标准方法)
3735
ablation_styles = {
3836
"Spectral MuP": {
39-
"color": "#F59E0B", # 琥珀金 (Amber-500)
37+
"color": ABLATION_COLORS[0],
4038
"linestyle": "-",
4139
"linewidth": 7,
42-
"alpha": 0.5,
43-
"label": "Spectral MuP (Standard)",
40+
"alpha": 0.66,
41+
"label": "Spectral $\\mu$P (Standard)",
4442
"zorder": 1,
4543
},
4644
"Spectral Kaiming": {
47-
"color": "#86198f", # 绛紫/洋红深色 (Fuchsia-800)
45+
"color": ABLATION_COLORS[1],
4846
"linestyle": "-",
49-
"linewidth": 3,
50-
"alpha": 0.9,
47+
"linewidth": 2,
48+
"alpha": 1.0,
5149
"label": "Spectral Kaiming",
5250
"zorder": 2,
5351
},
5452
"Align Adam RMS": {
55-
"color": "#0891b2", # 青色 (Cyan-600)
53+
"color": ABLATION_COLORS[2],
5654
"linestyle": "-",
57-
"linewidth": 3,
55+
"linewidth": 2,
5856
"alpha": 1.0,
5957
"label": "Align Adam RMS",
6058
"zorder": 3,
@@ -78,9 +76,12 @@
7876
valid_series = series[valid_mask].values
7977

8078
# 对数据进行smoothing(滚动平均)
81-
smoothed_series = pd.Series(valid_series).rolling(
82-
window=smooth_window, center=True, min_periods=1
83-
).mean().values
79+
smoothed_series = (
80+
pd.Series(valid_series)
81+
.rolling(window=smooth_window, center=True, min_periods=1)
82+
.mean()
83+
.values
84+
)
8485

8586
# 主曲线
8687
ax.plot(
@@ -114,4 +115,3 @@
114115

115116
output_file = os.path.join(output_dir, "lrscaler_ablation_loss.pdf")
116117
save_figure(fig, output_file, formats=["pdf", "png", "eps"])
117-

plot_figures/loss/plot_module_ablation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@
3737
"color": ABLATION_COLORS[0],
3838
"linestyle": "-",
3939
"linewidth": 7,
40-
"alpha": 0.8,
40+
"alpha": 0.66,
4141
"label": "All Split (Standard)",
4242
"zorder": 1,
4343
},
44-
"split ffn only": {
44+
"split qkv only": {
4545
"color": ABLATION_COLORS[1],
4646
"linestyle": "-",
4747
"linewidth": 2,
4848
"alpha": 1.0,
49-
"label": "Split FFN Only",
49+
"label": "Split QKV Only",
5050
"zorder": 2,
5151
},
52-
"split qkv only": {
52+
"split ffn only": {
5353
"color": ABLATION_COLORS[2],
5454
"linestyle": "-",
5555
"linewidth": 2,
5656
"alpha": 1.0,
57-
"label": "Split QKV Only",
57+
"label": "Split FFN Only",
5858
"zorder": 3,
5959
},
6060
}

plot_figures/loss/results/ablation/lrscaler_ablation_loss.eps

Lines changed: 664 additions & 458 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
2.64 KB
Binary file not shown.
815 Bytes
Loading

plot_figures/loss/results/ablation/module_ablation_loss.eps

Lines changed: 12166 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
105 KB
Binary file not shown.
326 KB
Loading

plot_figures/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
]
3030

3131
ABLATION_COLORS = [
32-
"#f6a823",
33-
"#4b08b2",
32+
"#f59e0b",
33+
"#86198f",
3434
"#0891b2",
3535
]
3636

0 commit comments

Comments
 (0)