From 308f2090a5fb51c4336309b357f0c3b990e49a45 Mon Sep 17 00:00:00 2001 From: 8x54zj-m <8x54zj-m@motrixlab.local> Date: Wed, 1 Jul 2026 15:39:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20VAE=20predicts=20next=20frame=20(paper:?= =?UTF-8?q?=20LVAE=20=3D=20MSE(=C3=B5=5F{t+1},=20o=5F{t+1})),=20history=20?= =?UTF-8?q?excludes=20current=20obs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/motrix_envs/locomotion/go1/dreamwaq.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py b/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py index 9e90458..8a1295f 100644 --- a/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py +++ b/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py @@ -335,11 +335,14 @@ class DreamWaQTask(Go1WalkTask): data.set_dof_pos(np.nan_to_num(np.array(dp), nan=0.0, posinf=0.0, neginf=0.0), self._model) obs = self._get_obs(data, state.info) - # 更新历史缓冲区 - old_history = state.info.get("obs_history", + # 更新历史缓冲区:CENet 用不含当前帧的历史预测下一帧(论文 LVAE = MSE(õ_{t+1}, o_{t+1})) + full_hist = state.info.get("obs_history_full", np.zeros((self._num_envs, self._cfg.num_history, 45), dtype=np.float32)) - new_history = np.concatenate([old_history[:, 1:, :], obs[:, np.newaxis, :]], axis=1) - state.info["obs_history"] = new_history + # 当前 CENet 输入:上一轮保存的历史(止于 o_{t-1}) + state.info["obs_history"] = full_hist + # 为下一轮准备新历史:滑窗 + 当前帧 + new_full = np.concatenate([full_hist[:, 1:, :], obs[:, np.newaxis, :]], axis=1) + state.info["obs_history_full"] = new_full current_step = state.info.get("steps", np.zeros(self._num_envs, dtype=np.int32))