Title: Fix RSSMRollout not advancing state/belief across time steps in Dreamer #3236
+3
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the RSSM rollout state propagation in
RSSMRollout.forward.At each timestep, after computing the prior and posterior, we now:
("next", *)keys to current usingstep_mdp(..., keep_other=True), andConcretely:
step_mdpimport, andstep_mdpinside the time loop before selectingin_keysand updating with the next step’s values.This ensures
("next", "state")and("next", "belief")are correctly advanced tostateandbelieffor the subsequent step.Motivation and Context
Previously, the rollout did not propagate
stateandbelieffrom("next", ...)back to the current keys, causing the loop to reuse stalestate/belief. This broke the intended posterior-to-prior chaining in Dreamer’s RSSM and led to incorrect latent rollouts (and potentially training instability and degraded reconstruction/reward predictions).The fix aligns the implementation with Dreamer’s design and the world model wiring used elsewhere (e.g., in
dreamer_utils._dreamer_make_world_model), where the prior for step t+1 must consume the posterior outputs of step t.If there is an open issue tracking this bug, please link it here.
Example:
close #XXXXTypes of changes
Checklist