mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-09-17 22:30:59 +00:00
Fix typos in SAC and TD3 (#145)
This commit is contained in:
parent
9003a09d5b
commit
a1afc5e42f
3 changed files with 5 additions and 4 deletions
|
|
@ -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:
|
||||
^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue