Merge branch 'master' into feat/crr

This commit is contained in:
Antonin RAFFIN 2020-08-23 17:47:39 +02:00
commit ff24b864e6
2 changed files with 3 additions and 2 deletions

View file

@ -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:
^^^^^^^^^^^^^^

View file

@ -152,10 +152,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()