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

+4 -2
View File
@@ -128,8 +128,10 @@ class ActionPredictorInference:
from action_norm import default_column_weights
col_w = default_column_weights(self.action_dim)
fixed = fixed_zero_columns(col_w, self.action_dim)
m = fixed != 0.0
result[m] = fixed[m]
# 按权重掩码覆盖(固定 0 的列也须覆盖——掩码不能只看常量值)
w = np.asarray(col_w, dtype=np.float32)
result[w[:self.action_dim] <= 0.0] = (
fixed[w[:self.action_dim] <= 0.0])
if not np.all(np.isfinite(result)):
result = np.nan_to_num(result, nan=0.0, posinf=0.0, neginf=0.0)
return result