From a1afc5e42f725ca74b6e82f723dad66fd7761f3f Mon Sep 17 00:00:00 2001 From: Antonin RAFFIN Date: Sun, 23 Aug 2020 17:44:35 +0200 Subject: [PATCH] Fix typos in SAC and TD3 (#145) --- docs/misc/changelog.rst | 1 + stable_baselines3/sac/sac.py | 4 ++-- stable_baselines3/td3/td3.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/misc/changelog.rst b/docs/misc/changelog.rst index af3b66d..364d17f 100644 --- a/docs/misc/changelog.rst +++ b/docs/misc/changelog.rst @@ -25,6 +25,7 @@ Others: ^^^^^^^ - Improve typing coverage of the ``VecEnv`` - Removed ``AlreadySteppingError`` and ``NotSteppingError`` that were not used +- Fixed typos in SAC and TD3 Documentation: ^^^^^^^^^^^^^^ diff --git a/stable_baselines3/sac/sac.py b/stable_baselines3/sac/sac.py index 7def773..637a875 100644 --- a/stable_baselines3/sac/sac.py +++ b/stable_baselines3/sac/sac.py @@ -231,10 +231,10 @@ class SAC(OffPolicyAlgorithm): # Get current Q estimates for each critic network # using action from the replay buffer - current_q_esimates = self.critic(replay_data.observations, replay_data.actions) + current_q_estimates = self.critic(replay_data.observations, replay_data.actions) # Compute critic loss - critic_loss = 0.5 * sum([F.mse_loss(current_q, q_backup) for current_q in current_q_esimates]) + critic_loss = 0.5 * sum([F.mse_loss(current_q, q_backup) for current_q in current_q_estimates]) critic_losses.append(critic_loss.item()) # Optimize the critic diff --git a/stable_baselines3/td3/td3.py b/stable_baselines3/td3/td3.py index 8b7c902..543674c 100644 --- a/stable_baselines3/td3/td3.py +++ b/stable_baselines3/td3/td3.py @@ -147,10 +147,10 @@ class TD3(OffPolicyAlgorithm): target_q = replay_data.rewards + (1 - replay_data.dones) * self.gamma * target_q # Get current Q estimates for each critic network - current_q_esimates = self.critic(replay_data.observations, replay_data.actions) + current_q_estimates = self.critic(replay_data.observations, replay_data.actions) # Compute critic loss - critic_loss = sum([F.mse_loss(current_q, target_q) for current_q in current_q_esimates]) + critic_loss = sum([F.mse_loss(current_q, target_q) for current_q in current_q_estimates]) # Optimize the critics self.critic.optimizer.zero_grad()