Hello everybody.
Can anyone please tell me why the “Accuracy” metric was not used in this part of the exercise?
https://github.com/https-deeplearning-ai/tensorflow-1-public/blob/main/C1/W2/ungraded_labs/C1_W2_Lab_1_beyond_hello_world.ipynb
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'])
model.fit(training_images, training_labels, epochs=5)
model.evaluate(test_images, test_labels)
classifications = model.predict(test_images)
print(classifications[0])
print(test_labels[0])
Hope it helps,