Skip to content

Commit 75c5389

Browse files
authored
[chat] fix compute_approx_kl (#4338)
1 parent 03654c0 commit 75c5389

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

applications/Chat/coati/models/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def compute_approx_kl(log_probs: torch.Tensor,
1919
action_mask: Mask for actions.
2020
"""
2121

22-
log_ratio = log_probs - log_probs_base
22+
log_ratio = log_probs_base - log_probs
2323
approx_kl = (log_ratio.exp() - 1) - log_ratio
2424
if action_mask is not None:
2525
approx_kl = masked_mean(approx_kl, action_mask, dim=1)

0 commit comments

Comments
 (0)