From dec7275dd444d1de682df1bc0073a4167d7c8c5a Mon Sep 17 00:00:00 2001 From: Lukas Linauer <85884720+llinauer@users.noreply.github.com> Date: Mon, 24 Jun 2024 19:25:29 +0200 Subject: [PATCH] Fix conditional for choosing deterministic action in SACPlayer get_action method (#290) --- rl_games/algos_torch/players.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rl_games/algos_torch/players.py b/rl_games/algos_torch/players.py index 3dfcdadd..2f82519b 100644 --- a/rl_games/algos_torch/players.py +++ b/rl_games/algos_torch/players.py @@ -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())