diff --git a/torchy_baselines/common/base_class.py b/torchy_baselines/common/base_class.py index bbcb951..b69e0aa 100644 --- a/torchy_baselines/common/base_class.py +++ b/torchy_baselines/common/base_class.py @@ -144,6 +144,8 @@ class BaseRLModel(ABC): """ Rescale the action from [low, high] to [-1, 1] (no need for symmetric action space) + + :param action: Action to scale """ low, high = self.action_space.low, self.action_space.high return 2.0 * ((action - low) / (high - low)) - 1.0 @@ -152,6 +154,8 @@ class BaseRLModel(ABC): """ Rescale the action from [-1, 1] to [low, high] (no need for symmetric action space) + + :param scaled_action: Action to un-scale """ low, high = self.action_space.low, self.action_space.high return low + (0.5 * (scaled_action + 1.0) * (high - low))