Definitions
Main-Source
# Assignment
Our trained model should predict on which number is written.
The output should look like the following:
# Implementation
Get MNIST-dataset
visualization
= 8
get to know dataset shape
= (60000, 28, 28) - amount of data, size of image
reshaping & normalizing
= x_train shape: (60000, 28, 28, 1)
Number of images in x_train 60000
Number of images in x_test 10000
build convolutional neural network
compiling & fitting the model
= Epoch 1/10
1875/1875 ββββββββββββββββββββ 23s 12ms/step - accuracy: 0.6364 - loss: 122.8531
Epoch 2/30
1875/1875 ββββββββββββββββββββ 22s 12ms/step - accuracy: 0.6373 - loss: 1.2093
evaluating
313/313 ββββββββββββββββββββ 2s 5ms/step - accuracy: 0.9617 - loss: 0.2242
β¦
Acc. ~ 96%
prediction for image
= 1/1 ββββββββββββββββββββ 0s 72ms/step
9