Path: blob/master/Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning/Week 3 - Enchancing Vision with Convolutional Neural Networks/Excercise-3-Question.ipynb
14462 views
Kernel: Python 3
Exercise 3
In the videos you looked at how you would improve Fashion MNIST using Convolutions. For your exercise see if you can improve MNIST to 99.8% accuracy or more using only a single convolutional layer and a single MaxPooling 2D. You should stop training once the accuracy goes above this amount. It should happen in less than 20 epochs, so it's ok to hard code the number of epochs for training, but your training must end once it hits the above metric. If it doesn't, then you'll need to redesign your layers.
I've started the code for you -- you need to finish it!
When 99.8% accuracy has been hit, you should print out the string "Reached 99.8% accuracy so cancelling training!"
In [1]:
In [2]:
In [11]:
In [12]:
Out[12]:
Epoch 1/20
60000/60000 [==============================] - 17s 285us/sample - loss: 0.1190 - acc: 0.9633
Epoch 2/20
60000/60000 [==============================] - 14s 230us/sample - loss: 0.0393 - acc: 0.9879
Epoch 3/20
60000/60000 [==============================] - 14s 230us/sample - loss: 0.0267 - acc: 0.9914 - loss: 0
Epoch 4/20
60000/60000 [==============================] - 14s 228us/sample - loss: 0.0188 - acc: 0.9938
Epoch 5/20
60000/60000 [==============================] - 14s 229us/sample - loss: 0.0149 - acc: 0.9952
Epoch 6/20
60000/60000 [==============================] - 14s 230us/sample - loss: 0.0112 - acc: 0.9964
Epoch 7/20
60000/60000 [==============================] - 14s 228us/sample - loss: 0.0087 - acc: 0.9969
Epoch 8/20
60000/60000 [==============================] - 14s 230us/sample - loss: 0.0078 - acc: 0.9973
Epoch 9/20
60000/60000 [==============================] - 14s 228us/sample - loss: 0.0068 - acc: 0.9976
Epoch 10/20
59648/60000 [============================>.] - ETA: 0s - loss: 0.0062 - acc: 0.9982
Reached 99.8% accuracy so cancelling training!
60000/60000 [==============================] - 14s 225us/sample - loss: 0.0061 - acc: 0.9982
In [ ]:
In [ ]:
In [ ]:
In [ ]: