fix(pybot×actpred): 微动作录制时间轴均匀化——首行分解为重复步,delay 列权重归零
pybot run():带 delay 的首行(无前序状态)不再单步执行,分解为 N=delay//10 个重复微步(插值退化恒等),录制数据全 10ms 均匀节拍, delay 列恒 10ms——行级时长信息已隐式编码在步数中,消除首行 200ms 造成的时间采样不均(frame_len/history_len 等间隔假设被破坏)。 actpred default_column_weights:spk.delay 权重 0.2→0.0(步级恒值列 无信号,与保留位同级);spk.F 保持 0.2。 新录制数据集(952 样本,delay 恒 10)存于 data/pybot_record_v2(不入库)。
This commit is contained in:
1 parent
1cf428f384
commit
99c1bc1739
5 files changed
+27
-18
No files matched your search
@@ -85,14 +85,15 @@ def denormalize_action(norm_action, action_dim: int = None,
|
||||
|
||||
|
||||
def default_column_weights(action_dim: int = 18) -> np.ndarray:
|
||||
"""逐列损失权重默认表:舵机 1.0(安全关键)、spk 0.2(保留梯度)、
|
||||
保留位 0.0(恒 0 纯噪声,参与只会稀释有效梯度)。
|
||||
"""逐列损失权重默认表:舵机 1.0(安全关键)、spk.F 0.2(保留梯度)、
|
||||
spk.delay 0.0(步级数据恒 10ms——微动作分解的隐式节拍,时长信息
|
||||
已编码在步数中)、保留位 0.0(恒 0 纯噪声,参与只会稀释有效梯度)。
|
||||
action_dim>18 的扩展列默认 1.0:超出当前 18 列语义布局的通道视为
|
||||
新执行器,静默给 0 会让其完全不参与训练(P2-a1)。"""
|
||||
w = np.zeros(action_dim, dtype=np.float32)
|
||||
w[:min(10, action_dim)] = 1.0
|
||||
if action_dim > 10:
|
||||
w[10:min(12, action_dim)] = 0.2
|
||||
w[10] = 0.2
|
||||
if action_dim > 18:
|
||||
w[18:] = 1.0
|
||||
return w
|
||||
@@ -2004,13 +2004,14 @@ class TestFixedRangeNorm(unittest.TestCase):
|
||||
from action_norm import default_column_weights
|
||||
w18 = default_column_weights(18)
|
||||
np.testing.assert_allclose(w18[:10], 1.0)
|
||||
np.testing.assert_allclose(w18[10:12], 0.2)
|
||||
np.testing.assert_allclose(w18[12:], 0.0)
|
||||
self.assertAlmostEqual(float(w18[10]), 0.2, places=6) # spk.F 保留梯度
|
||||
np.testing.assert_allclose(w18[11:], 0.0) # spk.delay 步级恒值 + 保留位
|
||||
# 小 action_dim:全部落在舵机段 → 全 1.0
|
||||
np.testing.assert_allclose(default_column_weights(4), 1.0)
|
||||
# 12 列:舵机 1.0 + spk 0.2
|
||||
# 12 列:舵机 1.0 + spk.F 0.2,delay 0
|
||||
w12 = default_column_weights(12)
|
||||
np.testing.assert_allclose(w12[10:], 0.2)
|
||||
self.assertAlmostEqual(float(w12[10]), 0.2, places=6)
|
||||
self.assertEqual(float(w12[11]), 0.0)
|
||||
# 20 列:超出 18 列语义布局的扩展列默认 1.0(新执行器须参与训练)
|
||||
w20 = default_column_weights(20)
|
||||
np.testing.assert_allclose(w20[12:18], 0.0)
|
||||
|
||||
Reference in new issue
Block a user