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