docs(actpred): 模型 B zscore 等权稳定基线文档 + spk 两列固定常量
B 是六模型闭环评估中唯一稳定配置(2445/0.082),固化完整方案作为 部署基线与实验对照基准,并总结归一化系列失败机理(反馈回路需误差 有界且收缩)。配套实现:spk.F/spk.delay 权重归零、推理/反馈固定 常量(bins.FIXED_OUTPUT),拔除闭环发散源,为 B2(zscore+v2)与 F2(onehot+固定)铺路。
This commit is contained in:
1 parent
7f21b65428
commit
9000bb4b04
6 files changed
+149
-15
No files matched your search
+16
-5
@@ -2004,14 +2004,12 @@ class TestFixedRangeNorm(unittest.TestCase):
|
||||
from action_norm import default_column_weights
|
||||
w18 = default_column_weights(18)
|
||||
np.testing.assert_allclose(w18[:10], 1.0)
|
||||
self.assertAlmostEqual(float(w18[10]), 0.2, places=6) # spk.F 保留梯度
|
||||
np.testing.assert_allclose(w18[11:], 0.0) # spk.delay 步级恒值 + 保留位
|
||||
np.testing.assert_allclose(w18[10:], 0.0) # spk 两列 + 保留位全 0
|
||||
# 小 action_dim:全部落在舵机段 → 全 1.0
|
||||
np.testing.assert_allclose(default_column_weights(4), 1.0)
|
||||
# 12 列:舵机 1.0 + spk.F 0.2,delay 0
|
||||
# 12 列:舵机 1.0,spk 两列 0
|
||||
w12 = default_column_weights(12)
|
||||
self.assertAlmostEqual(float(w12[10]), 0.2, places=6)
|
||||
self.assertEqual(float(w12[11]), 0.0)
|
||||
np.testing.assert_allclose(w12[10:], 0.0)
|
||||
# 20 列:超出 18 列语义布局的扩展列默认 1.0(新执行器须参与训练)
|
||||
w20 = default_column_weights(20)
|
||||
np.testing.assert_allclose(w20[12:18], 0.0)
|
||||
@@ -2502,6 +2500,19 @@ class TestOneHot(unittest.TestCase):
|
||||
with self.assertRaises(ValueError):
|
||||
validate_config_values(cfg.data, cfg.model, cfg.train)
|
||||
|
||||
def test_fixed_zero_columns(self):
|
||||
"""权重 0 列固定常量:spk.F→0、spk.delay→10ms、保留位→0"""
|
||||
from bins import fixed_zero_columns
|
||||
from action_norm import default_column_weights
|
||||
fixed = fixed_zero_columns(default_column_weights(18), 18)
|
||||
np.testing.assert_allclose(fixed[:10], 0.0)
|
||||
self.assertEqual(float(fixed[10]), 0.0)
|
||||
self.assertEqual(float(fixed[11]), 10.0)
|
||||
np.testing.assert_allclose(fixed[12:], 0.0)
|
||||
# 全 1 权重 → 无固定列
|
||||
np.testing.assert_allclose(
|
||||
fixed_zero_columns(np.ones(4), 4), 0.0)
|
||||
|
||||
def test_onehot_model_output_shape(self):
|
||||
"""onehot 模型前向输出 TOTAL_BINS logits"""
|
||||
cfg = Config()
|
||||
|
||||
Reference in new issue
Block a user