Implement the forward rollout of an action-conditioned autoregressive dynamics model for video latents. Given an initial latent frame representation and a sequence of actions, the model predicts the next latent at each step by conditioning on the current latent and the current action, then feeds its prediction back as input for the next step.
At each timestep, the action is used to modulate the current latent via per-feature scale and shift parameters (predicted from the action through a linear projection). The modulated latent is then passed through a hidden transformation with a tanh nonlinearity, and the output is added to the current latent as a residual update to produce the next latent. This newly predicted latent becomes the input for the following step.
Parameters:
z0: Initial latent of shape (D,)actions: Action sequence of shape (T, A)W_scale: Shape (A, D) - projects action to per-feature scaleb_scale: Shape (D,) - bias added to the scaleW_shift: Shape (A, D) - projects action to per-feature shiftb_shift: Shape (D,) - bias added to the shiftW_hidden: Shape (D, D) - hidden projection weightsb_hidden: Shape (D,) - hidden biasW_out: Shape (D, D) - output projection weightsb_out: Shape (D,) - output biasReturn the predicted latent sequence as an array of shape (T, D) containing z_1, z_2, ..., z_T.