Skip to content

Commit

Permalink
Add scaling for non-clipped value loss
Browse files Browse the repository at this point in the history
  • Loading branch information
ikostrikov2 committed Sep 26, 2018
1 parent 7d06082 commit 12c3934
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion algo/ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def update(self, rollouts):
value_losses_clipped = (value_pred_clipped - return_batch).pow(2)
value_loss = .5 * torch.max(value_losses, value_losses_clipped).mean()
else:
value_loss = F.mse_loss(return_batch, values)
value_loss = 0.5 * F.mse_loss(return_batch, values)

self.optimizer.zero_grad()
(value_loss * self.value_loss_coef + action_loss -
Expand Down

0 comments on commit 12c3934

Please sign in to comment.