rollout#

Functions#

prt_rl.model_based.planners.rollout.rollout_action_sequence(model_config: Any, model_fcn: callable, initial_state: Tensor, action_sequence: Tensor)[source]#

Rollout a sequence of actions using the provided model starting from the initial state.

Parameters:
  • model – The model used to predict the next state.

  • initial_state (torch.Tensor) – The initial state of the environment.

  • action_sequence (torch.Tensor) – A sequence of actions to be taken.

Returns:

A dictionary containing the states, actions, and next_states encountered during the rollout.
  • ’state’: Tensor of shape (B, T, state_dim) containing the states at each time step.

  • ’action’: Tensor of shape (B, T, action_dim) containing the actions taken at each time step.

  • ’next_state’: Tensor of shape (B, T, state_dim) containing the next states at each time step.

Return type:

Dict[str, torch.Tensor]