Skip to content

Commit

Permalink
Make NOISE_CLIP_VALUE private.
Browse files Browse the repository at this point in the history
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: 565056772
  • Loading branch information
kenjitoyama authored and copybara-github committed Sep 13, 2023
1 parent 3ec9b03 commit 49fd98e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions android_env/wrappers/discrete_action_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import numpy as np


NOISE_CLIP_VALUE = 0.4999
_NOISE_CLIP_VALUE = 0.4999


class DiscreteActionWrapper(base_wrapper.BaseWrapper):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 49fd98e

Please sign in to comment.