clip_fraction calc broken for clip_fraction=None
This commit is contained in:
parent
54b841654b
commit
c67f78159b
@ -253,8 +253,12 @@ class TRPL(BetterOnPolicyAlgorithm):
|
||||
|
||||
# Logging
|
||||
pg_losses.append(surrogate_loss.item())
|
||||
clip_fraction = th.mean((th.abs(ratio - 1) > clip_range).float()).item()
|
||||
if self.clip_range is not None:
|
||||
clip_fraction = th.mean((th.abs(ratio - 1) > clip_range).float()).item()
|
||||
else:
|
||||
clip_fraction = 0
|
||||
clip_fractions.append(clip_fraction)
|
||||
|
||||
|
||||
if self.clip_range_vf is None:
|
||||
# No clipping
|
||||
|
Loading…
Reference in New Issue
Block a user