This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Epoch 1/15 | |
| 1875/1875 [==============================] - 3s 2ms/step - loss: 0.2570 - accuracy: 0.9265 | |
| Epoch 2/15 | |
| 1875/1875 [==============================] - 4s 2ms/step - loss: 0.1133 - accuracy: 0.9667 | |
| Epoch 3/15 | |
| 1875/1875 [==============================] - 3s 2ms/step - loss: 0.0778 - accuracy: 0.9765 | |
| Epoch 4/15 | |
| 1875/1875 [==============================] - 3s 2ms/step - loss: 0.0580 - accuracy: 0.9822 | |
| Epoch 5/15 | |
| 1875/1875 [==============================] - 3s 2ms/step - loss: 0.0444 - accuracy: 0.9859 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tensorflow as tf | |
| # Callback function to check model accuracy | |
| class RayCallback(tf.keras.callbacks.Callback): | |
| def on_epoch_end(self, epoch, logs={}): | |
| if(logs.get('accuracy')>0.998): | |
| print("\nReached 99.8% accuracy so cancelling training!") | |
| self.model.stop_training = True | |
| # Load the MNIST handwrite digit data set |
OlderNewer