Fixed error on clip_range None

This commit is contained in:
Dominik Moritz Roth 2024-01-23 09:22:58 +01:00
parent e3f4c511bf
commit 252710489e

View File

@ -186,7 +186,8 @@ class TRPL(BetterOnPolicyAlgorithm):
super()._setup_model() super()._setup_model()
# Initialize schedules for policy/value clipping # Initialize schedules for policy/value clipping
self.clip_range = get_schedule_fn(self.clip_range) if self.clip_range is not None:
self.clip_range = get_schedule_fn(self.clip_range)
if self.clip_range_vf is not None: if self.clip_range_vf is not None:
if isinstance(self.clip_range_vf, (float, int)): if isinstance(self.clip_range_vf, (float, int)):
assert self.clip_range_vf > 0, "`clip_range_vf` must be positive, " "pass `None` to deactivate vf clipping" assert self.clip_range_vf > 0, "`clip_range_vf` must be positive, " "pass `None` to deactivate vf clipping"