Skip to content

Commit

Permalink
cap sac temperature at 0 (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpnota committed Jun 3, 2021
1 parent bd40aa9 commit 4122e0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion all/agents/sac.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _train(self):

# adjust temperature
temperature_grad = (_log_probs + self.entropy_target).mean()
self.temperature += self.lr_temperature * temperature_grad.detach()
self.temperature = max(0, self.temperature + self.lr_temperature * temperature_grad.detach())

# additional debugging info
self.writer.add_loss('entropy', -_log_probs.mean())
Expand Down

0 comments on commit 4122e0a

Please sign in to comment.