mirror of
https://github.com/vale981/ray
synced 2025-03-05 18:11:42 -05:00
[RLlib] Fix crash when kl_coeff is set to 0 (#23063)
Co-authored-by: Jeroen Bédorf <jeroen@minds.ai> Co-authored-by: Ishant Mrinal Haloi <mrinal.haloi11@gmail.com> Co-authored-by: Ishant Mrinal <33053278+n30111@users.noreply.github.com>
This commit is contained in:
parent
e9ae784e62
commit
bc21a4593d
1 changed files with 1 additions and 1 deletions
|
@ -98,7 +98,7 @@ def ppo_surrogate_loss(
|
|||
action_kl = prev_action_dist.kl(curr_action_dist)
|
||||
mean_kl_loss = reduce_mean_valid(action_kl)
|
||||
else:
|
||||
mean_kl_loss = 0.0
|
||||
mean_kl_loss = tf.constant(0.0)
|
||||
|
||||
curr_entropy = curr_action_dist.entropy()
|
||||
mean_entropy = reduce_mean_valid(curr_entropy)
|
||||
|
|
Loading…
Add table
Reference in a new issue