November 2018
Intermediate to advanced
322 pages
7h 54m
English
Keras is a high-level library that is available as part of TensorFlow. In this section, we will rebuild the same model we built earlier with TensorFlow core with Keras:
x_train_im = mnist.load_images(x_train)x_train_im, x_test_im = x_train_im / 255.0, x_test / 255.0
In the preceding code, we are loading the training images in memory before both the training and test images are scaled, which we do by dividing them by 255.
model = tf.keras.models.Sequential([ tf.keras.layers.Flatten(), tf.keras.layers.Dense(10, activation=tf.nn.softmax)])
Read now
Unlock full access