fix(actpred): 固定 0 列未被覆盖——掩码按权重而非常量值

fixed_zero_columns 对 spk.F 返回常量 0,调用处掩码 fixed!=0 将其
排除,spk.F 垃圾预测(69-423Hz)继续进闭环。改为按权重<=0 掩码
覆盖(含固定 0 的列)。修正后舵机闭环 MSE 14477 假象 → 293 真实
(hand 类 55K 是固定 0 vs 真值 1000 的指标伪影)。+1 回归测试。
This commit is contained in:
qing committed 2026-08-15 10:02:49 +00:00
1 parent 8a9a061662
commit 37feb09185
3 files changed
+22 -4

No files matched your search

+2 -2
View File
@@ -130,8 +130,8 @@ def train_one_epoch(model, loader, optimizer, device, max_grad_norm: float = Non
# 权重 0 列固定为常量,防自预测垃圾进入历史
fixed = fixed_zero_columns(
weights.cpu().numpy(), action_dim)
m = fixed != 0.0
raw[m] = fixed[m]
w = weights.cpu().numpy()[:action_dim]
raw[w <= 0.0] = fixed[w <= 0.0]
abs_action = torch.from_numpy(normalize_action(
raw, action_dim, mode=range_mode)).to(device)
else: