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".
  
  It also provides random starting no-ops, which are used in the Rainbow, Apex
  and R2D2 papers.
class_docstr_tok: ["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","''",".","It","also","provides","random","starting","no-ops",",","which","are","used","in","the","Rainbow",",","Apex","and","R2D2","papers","."]
docstr: Renders the current screen, before preprocessing.
  
  This calls the Gym API's render() method.
  
  Args:
    mode: Mode argument for the environment's render() method.
      Valid values (str) are:
        'rgb_array': returns the raw ALE image.
        'human': renders to display via the Gym renderer.
  
  Returns:
    if mode='rgb_array': numpy array, the most recent screen.
    if mode='human': bool, whether the rendering was successful.
docstr_tok: ["Renders","the","current","screen",",","before","preprocessing",".","This","calls","the","Gym","API","'s","render","(",")","method",".","Args",":","mode",":","Mode","argument","for","the","environment","'s","render","(",")","method",".","Valid","values","(","str",")","are",":","'rgb_array","'",":","returns","the","raw","ALE","image",".","'human","'",":","renders","to","display","via","the","Gym","renderer",".","Returns",":","if","mode='rgb_array","'",":","numpy","array",",","the","most","recent","screen",".","if","mode='human","'",":","bool",",","whether","the","rendering","was","successful","."]
code: def render(self, mode):
      """Renders the current screen, before preprocessing.
  
      This calls the Gym API's render() method.
  
      Args:
        mode: Mode argument for the environment's render() method.
          Valid values (str) are:
            'rgb_array': returns the raw ALE image.
            'human': renders to display via the Gym renderer.
  
      Returns:
        if mode='rgb_array': numpy array, the most recent screen.
        if mode='human': bool, whether the rendering was successful.
      """
      return self.environment.render(mode)
  
file_path: moolib/py/moolib/examples/atari/atari_preprocessing.py
imports: from gym.spaces.box import Box
  import numpy
  import cv2
label_desc: Use image node_id 9 for calling the AtariPreprocessing obj's underlying member method code with example usage: obj.render(mode) and returns: self