class_docstr: A class implementing image preprocessing for Atari 2600 agents.
  
  Specifically, this provides the following subset from the JAIR paper
  (Bellemare et al., 2013) and Nature DQN paper (Mnih et al., 2015):
  
    * Frame skipping (defaults to 4).
    * Terminal signal when a life is lost (off by default).
    * Grayscale and max-pooling of the last two frames.
    * Downsample the screen to a square image (defaults to 84x84).
  
  More generally, this class follows the preprocessing guidelines set down in
  Machado et al. (2018), "Revisiting the Arcade Learning Environment:
  Evaluation Protocols and Open Problems for General Agents".
docstr: Transforms two frames into a Nature DQN observation.
  
  For efficiency, the transformation is done in-place in self.screen_buffer.
  
  Returns:
    transformed_screen: numpy array, pooled, resized screen.
docstr_tok: ["Transforms","two","frames","into","a","Nature","DQN","observation",".","For","efficiency",",","the","transformation","is","done","in-place","in","self.screen_buffer",".","Returns",":","transformed_screen",":","numpy","array",",","pooled",",","resized","screen","."]
code: def _pool_and_resize(self):
      """Transforms two frames into a Nature DQN observation.
  
      For efficiency, the transformation is done in-place in self.screen_buffer.
  
      Returns:
        transformed_screen: numpy array, pooled, resized screen.
      """
      # Pool if there are enough screens to do so.
      if self.frame_skip > 1:
          np.maximum(
              self.screen_buffer[0],
              self.screen_buffer[1],
              out=self.screen_buffer[0],
          )
  
      transformed_image = cv2.resize(
          self.screen_buffer[0],
          (self.screen_size, self.screen_size),
          interpolation=cv2.INTER_AREA,
      )
      int_image = np.asarray(transformed_image, dtype=np.uint8)
      return np.expand_dims(int_image, axis=2)
  
file_path: agents/tf_agents/environments/atari_preprocessing.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import cv2
  import gin
  import gym
  from gym import core
  from gym.spaces import box
  import numpy
label_desc: Use image node_id 5 for calling the AtariPreprocessing obj's underlying member method code with example usage: obj._pool_and_resize() and returns: np