October 2018
Intermediate to advanced
472 pages
10h 57m
English
To generate low-resolution images, define a function called reshape() that will resize the input image/digit to size 14*14. After defining this, we will use the reshape() function to generate low-resolution train and test images:
def reshape(x): """Reshape images to 14*14""" img = imresize(x.reshape(28,28), (14, 14)) return img# create 14*14 low resolution train and test imagesXX_train = np.array([*map(reshape, X_train.astype(float))])XX_test = np.array([*map(reshape, X_test.astype(float))])
XX_train and XX_test will be the images that we will feed into the encoder, and X_train and X_test will be the targets.
Read now
Unlock full access