From 54b841654b0b2b1d9c42cd9674cbf28d2546a0f1 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Tue, 23 Jan 2024 11:23:35 +0100 Subject: [PATCH] Fix another issue when clip_range=None --- metastable_baselines2/trpl/trpl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metastable_baselines2/trpl/trpl.py b/metastable_baselines2/trpl/trpl.py index 043341a..c1329e8 100644 --- a/metastable_baselines2/trpl/trpl.py +++ b/metastable_baselines2/trpl/trpl.py @@ -203,7 +203,8 @@ class TRPL(BetterOnPolicyAlgorithm): # Update optimizer learning rate self._update_learning_rate(self.policy.optimizer) # Compute current clip range - clip_range = self.clip_range(self._current_progress_remaining) + if self.clip_range is not None: + clip_range = self.clip_range(self._current_progress_remaining) # Optional: clip range for the value function if self.clip_range_vf is not None: clip_range_vf = self.clip_range_vf(self._current_progress_remaining)