Skip to content

Commit

Permalink
average critic loss in twin critic
Browse files Browse the repository at this point in the history
Summary: avearge critic loss in twin critic instead of taking the sum

Reviewed By: BerenLuthien

Differential Revision: D59823732

fbshipit-source-id: 5fe68de1aab8e26d68ecc89364d2f83a1f0c2639
  • Loading branch information
Yonathan Efroni authored and facebook-github-bot committed Jul 16, 2024
1 parent 13e5ffc commit d1b22eb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pearl/utils/functional_utils/learning/critic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,5 @@ def twin_critic_action_value_loss(
loss = criterion(
q_1.reshape_as(expected_target_batch), expected_target_batch.detach()
) + criterion(q_2.reshape_as(expected_target_batch), expected_target_batch.detach())
loss = loss / 2.0
return loss, q_1, q_2

0 comments on commit d1b22eb

Please sign in to comment.