This commit is contained in:
Alexander Soare 2024-05-17 14:50:52 +01:00
parent 7962f1e732
commit f54b7a46a7
1 changed files with 2 additions and 0 deletions

View File

@ -105,6 +105,8 @@ class ACTPolicy(nn.Module, PyTorchModelHubMixin):
actions = self.model(batch)[0] # (batch_size, chunk_size, action_dim)
actions = self.unnormalize_outputs({"action": actions})["action"]
if self._ensembled_actions is None:
# Initializes `self._ensembled_action` to the sequence of actions predicted during the first
# time step of the episode.
self._ensembled_actions = actions.clone()
else:
# self._ensembled_actions will have shape (batch_size, chunk_size - 1, action_dim). Compute