(I)
return I.astype(np.float).ravel()
prepro 210x160x3 uint8 frame into 6400 (80x80) 1D float vector
prepro 210x160x3 uint8 frame into 6400 (80x80) 1D float vector
prepro 210x160x3 uint8 frame into 6400 ( 80x80 ) 1D float vector
def prepro(I):
  """ prepro 210x160x3 uint8 frame into 6400 (80x80) 1D float vector """
  I = I[35:195] # crop
  I = I[::2,::2,0] # downsample by factor of 2
  I[I == 144] = 0 # erase background (background type 1)
  I[I == 109] = 0 # erase background (background type 2)
  I[I != 0] = 1 # everything else (paddles, ball) just set to 1
  return I.astype(np.float).ravel()
def prepro ( I ) : I = I [ 35 : 195 ] # crop I = I [ : : 2 , : : 2 , 0 ] # downsample by factor of 2 I [ I == 144 ] = 0 # erase background (background type 1) I [ I == 109 ] = 0 # erase background (background type 2) I [ I != 0 ] = 1 # everything else (paddles, ball) just set to 1 return I . astype ( np . float ) . ravel ( )