class_docstr: <a id="GameEnvironment"></a>
  
  ## Game environment
  
  This is a wrapper for OpenAI gym game environment.
  We do a few things here:
  
  1. Apply the same action on four frames and get the last frame
  2. Convert observation frames to gray and scale it to (84, 84)
  3. Stack four frames of the last four actions
  4. Add episode information (total reward for the entire episode) for monitoring
  5. Restrict an episode to a single life (game has 5 lives, we reset after every single life)
  
  #### Observation format
  Observation is tensor of size (4, 84, 84). It is four frames
  (images of the game screen) stacked on first axis.
  i.e, each channel is a frame.
class_docstr_tok: ["<","a","id=","''","GameEnvironment","''",">","<","\/a",">","#","#","Game","environment","This","is","a","wrapper","for","OpenAI","gym","game","environment",".","We","do","a","few","things","here",":","1",".","Apply","the","same","action","on","four","frames","and","get","the","last","frame","2",".","Convert","observation","frames","to","gray","and","scale","it","to","(","84",",","84",")","3",".","Stack","four","frames","of","the","last","four","actions","4",".","Add","episode","information","(","total","reward","for","the","entire","episode",")","for","monitoring","5",".","Restrict","an","episode","to","a","single","life","(","game","has","5","lives",",","we","reset","after","every","single","life",")","#","#","#","#","Observation","format","Observation","is","tensor","of","size","(","4",",","84",",","84",")",".","It","is","four","frames","(","images","of","the","game","screen",")","stacked","on","first","axis",".","i.e",",","each","channel","is","a","frame","."]
docstr: ### Reset environment
  Clean up episode info and 4 frame stack
docstr_tok: ["#","#","#","Reset","environment","Clean","up","episode","info","and","4","frame","stack"]
code: def reset(self):
      """
      ### Reset environment
      Clean up episode info and 4 frame stack
      """
  
      # reset OpenAI Gym environment
      obs = self.env.reset()
  
      # reset caches
      obs = self._process_obs(obs)
      for i in range(4):
          self.obs_4[i] = obs
      self.rewards = []
  
      self.lives = self.env.unwrapped.ale.lives()
  
      return self.obs_4
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/rl/game.py
imports: import multiprocessing
  import multiprocessing.connection
  import cv2
  import gym
  import numpy
label_desc: Use image node_id 3 for calling the Game obj's underlying member method code with example usage: obj.reset() and returns: self