(viz=False, train=False)
| 41 | |
| 42 | |
| 43 | def get_player(viz=False, train=False): |
| 44 | if USE_GYM: |
| 45 | env = gym.make(ENV_NAME) |
| 46 | else: |
| 47 | from atari import AtariPlayer |
| 48 | env = AtariPlayer(ENV_NAME, frame_skip=4, viz=viz, |
| 49 | live_lost_as_eoe=train, max_num_frames=60000) |
| 50 | env = FireResetEnv(env) |
| 51 | env = MapState(env, lambda im: resize_keepdims(im, IMAGE_SIZE)) |
| 52 | if not train: |
| 53 | # in training, history is taken care of in expreplay buffer |
| 54 | env = FrameStack(env, FRAME_HISTORY) |
| 55 | if train and USE_GYM: |
| 56 | env = LimitLength(env, 60000) |
| 57 | return env |
| 58 | |
| 59 | |
| 60 | class Model(DQNModel): |
no test coverage detected