Accuracy in Get hands-on with computer vision (Lab 1)

Hello everybody.

Can anyone please tell me why the “Accuracy” metric was not used in this part of the exercise?

In exercise 1, the author follows the model of an example above, where 128 neurons were used in the “ReLu” activation.

In exercise 2, he tries to demonstrate the result using 1024 neurons.

And ask lobe below what is the expected result, but the metric = accuracy in the result is not shown.

Hi @menezesluiz,

Based on next question, I believe it’s something that’s missing in example 2.

It should read:

mnist = tf.keras.datasets.mnist

(training_images, training_labels) ,  (test_images, test_labels) = mnist.load_data()

training_images = training_images/255.0
test_images = test_images/255.0

model = tf.keras.models.Sequential([tf.keras.layers.Flatten(),
                                    tf.keras.layers.Dense(1024, activation=tf.nn.relu), # Try experimenting with this layer
                                    tf.keras.layers.Dense(10, activation=tf.nn.softmax)])

model.compile(optimizer = 'adam',
              loss = 'sparse_categorical_crossentropy',
              metrics=['accuracy']), training_labels, epochs=5)

model.evaluate(test_images, test_labels)

classifications = model.predict(test_images)


Hope it helps,