|
61 | 61 | from tensor2tensor.rl.envs.simulated_batch_env import PIL_Image
|
62 | 62 | from tensor2tensor.rl.envs.simulated_batch_env import PIL_ImageDraw
|
63 | 63 | from tensor2tensor.rl.envs.simulated_batch_gym_env import FlatBatchEnv
|
64 |
| -from tensor2tensor.rl.rl_utils import absolute_hinge_difference, full_game_name |
| 64 | +from tensor2tensor.rl.rl_utils import absolute_hinge_difference |
| 65 | +from tensor2tensor.rl.rl_utils import full_game_name |
65 | 66 | # Import flags from t2t_trainer and trainer_model_based
|
66 | 67 | import tensor2tensor.rl.trainer_model_based_params # pylint: disable=unused-import
|
67 | 68 | from tensor2tensor.utils import registry
|
@@ -136,7 +137,7 @@ class PlayerEnv(gym.Env):
|
136 | 137 | HEADER_HEIGHT = 27
|
137 | 138 |
|
138 | 139 | def __init__(self, action_meanings):
|
139 |
| - """ |
| 140 | + """Constructor for PlayerEnv. |
140 | 141 |
|
141 | 142 | Args:
|
142 | 143 | action_meanings: list of strings indicating action names. Can be obtain by
|
@@ -252,7 +253,6 @@ def _augment_observation(self, ob, reward, cumulative_reward):
|
252 | 253 | pixel_fill = (0, 255, 0)
|
253 | 254 | else:
|
254 | 255 | pixel_fill = (255, 0, 0)
|
255 |
| - pixel_fill = (255, 0, 0) |
256 | 256 | header[0, :, :] = pixel_fill
|
257 | 257 | return np.concatenate([header, ob], axis=0)
|
258 | 258 |
|
@@ -312,6 +312,10 @@ def __init__(self, real_env, sim_env, action_meanings):
|
312 | 312 | sim_env: simulation of `real_env` to be compared with. E.g.
|
313 | 313 | `SimulatedGymEnv` must allow to update initial frames for next reset
|
314 | 314 | with `add_to_initial_stack` method.
|
| 315 | + action_meanings: list of strings indicating action names. Can be obtain by |
| 316 | + >>> env = gym.make("PongNoFrameskip-v4") # insert your game name |
| 317 | + >>> env.unwrapped.get_action_meanings() |
| 318 | + See gym AtariEnv get_action_meanings() for more details. |
315 | 319 | """
|
316 | 320 | super(SimAndRealEnvPlayer, self).__init__(action_meanings)
|
317 | 321 | assert real_env.observation_space.shape == sim_env.observation_space.shape
|
|
0 commit comments