From dda17ea935ec6bd211c0e457c809c3a99b6f2bb1 Mon Sep 17 00:00:00 2001 From: Daniel Toyama Date: Wed, 13 Sep 2023 08:17:45 -0700 Subject: [PATCH] Make `NOISE_CLIP_VALUE` private. This value doesn't need to be exposed to other modules. In parallel, this tests whether our copybara workflow is still working, since we moved from the `deepmind` to the `google-deepmind` organization. PiperOrigin-RevId: 565055470 --- android_env/wrappers/discrete_action_wrapper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android_env/wrappers/discrete_action_wrapper.py b/android_env/wrappers/discrete_action_wrapper.py index 183b954..e9867d8 100644 --- a/android_env/wrappers/discrete_action_wrapper.py +++ b/android_env/wrappers/discrete_action_wrapper.py @@ -24,7 +24,7 @@ import numpy as np -NOISE_CLIP_VALUE = 0.4999 +_NOISE_CLIP_VALUE = 0.4999 class DiscreteActionWrapper(base_wrapper.BaseWrapper): @@ -134,8 +134,8 @@ def _get_touch_position(self, action_id: int) -> Sequence[float]: noise_y = np.random.normal(loc=0.0, scale=self._noise) # Noise is clipped so that the action will strictly stay in the cell. - noise_x = max(min(noise_x, NOISE_CLIP_VALUE), -NOISE_CLIP_VALUE) - noise_y = max(min(noise_y, NOISE_CLIP_VALUE), -NOISE_CLIP_VALUE) + noise_x = max(min(noise_x, _NOISE_CLIP_VALUE), -_NOISE_CLIP_VALUE) + noise_y = max(min(noise_y, _NOISE_CLIP_VALUE), -_NOISE_CLIP_VALUE) x_pos = (x_pos_grid + 0.5 + noise_x) / self._action_grid[1] # WIDTH y_pos = (y_pos_grid + 0.5 + noise_y) / self._action_grid[0] # HEIGHT