Skip to content

Commit

Permalink
Fix conditional for choosing deterministic action in SACPlayer get_ac…
Browse files Browse the repository at this point in the history
…tion method (#290)
  • Loading branch information
llinauer authored Jun 24, 2024
1 parent 66970f8 commit dec7275
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rl_games/algos_torch/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def get_action(self, obs, is_deterministic=False):
if self.has_batch_dimension == False:
obs = unsqueeze_obs(obs)
dist = self.model.actor(obs)
actions = dist.sample() if is_deterministic else dist.mean
actions = dist.sample() if not is_deterministic else dist.mean
actions = actions.clamp(*self.action_range).to(self.device)
if self.has_batch_dimension == False:
actions = torch.squeeze(actions.detach())
Expand Down

0 comments on commit dec7275

Please sign in to comment.