November 2018
Intermediate to advanced
322 pages
7h 54m
English
We need to pre-process our data for making it ready to feed into our model, define our model, and create an evaluation metric:
x_train = x_train.reshape(x_train.shape[0], IMAGE_SIZE, IMAGE_SIZE, 1)x_test = x_test.reshape(x_test.shape[0], IMAGE_SIZE, IMAGE_SIZE, 1)x_train = x_train.astype('float32')x_test = x_test.astype('float32')Next, we normalize the image pixels by 255 as follows:x_train /= 255x_test /= 255And finally, we convert the class labels to one hot for training as follows: ...Read now
Unlock full access