'return a mean image of all (train and test) images of size 32x32x3'

def get_per_pixel_mean(self):

    fnames = get_filenames(self.dir, self.cifar_classnum)
    all_imgs = [x[0] for x in read_cifar(fnames, self.cifar_classnum)]
    arr = np.array(all_imgs, dtype='float32')
    mean = np.mean(arr, axis=0)
    return mean
