Update Google-ML-Crash-Course_MNIST_model.py
Browse files
Google-ML-Crash-Course_MNIST_model.py
CHANGED
|
@@ -26,6 +26,31 @@ Softmax The activation function on the output layer that converts the outputs in
|
|
| 26 |
In summary:
|
| 27 |
It's a DNN/MLP: It uses stacked Dense (fully-connected) layers.
|
| 28 |
It's not a CNN: It lacks Conv2D and MaxPooling2D layers, and it flattens the image data, discarding the crucial 2D spatial information that CNNs are built to exploit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
"""
|
| 30 |
|
| 31 |
import glob
|
|
|
|
| 26 |
In summary:
|
| 27 |
It's a DNN/MLP: It uses stacked Dense (fully-connected) layers.
|
| 28 |
It's not a CNN: It lacks Conv2D and MaxPooling2D layers, and it flattens the image data, discarding the crucial 2D spatial information that CNNs are built to exploit.
|
| 29 |
+
|
| 30 |
+
Model Summary:
|
| 31 |
+
/usr/local/lib/python3.11/dist-packages/keras/src/layers/core/input_layer.py:27: UserWarning: Argument `input_shape` is deprecated. Use `shape` instead.
|
| 32 |
+
warnings.warn(
|
| 33 |
+
Model: "sequential_1"
|
| 34 |
+
βββββββββββββββββββββββββββββββββββ³βββββββββββββββββββββββββ³ββββββββββββββββ
|
| 35 |
+
β Layer (type) β Output Shape β Param # β
|
| 36 |
+
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
|
| 37 |
+
β dense_3 (Dense) β (None, 100) β 78,500 β
|
| 38 |
+
βββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββΌββββββββββββββββ€
|
| 39 |
+
β dense_4 (Dense) β (None, 100) β 10,100 β
|
| 40 |
+
βββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββΌββββββββββββββββ€
|
| 41 |
+
β dropout_1 (Dropout) β (None, 100) β 0 β
|
| 42 |
+
βββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββΌββββββββββββββββ€
|
| 43 |
+
β dense_5 (Dense) β (None, 10) β 1,010 β
|
| 44 |
+
βββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββ΄ββββββββββββββββ
|
| 45 |
+
Total params: 89,610 (350.04 KB)
|
| 46 |
+
Trainable params: 89,610 (350.04 KB)
|
| 47 |
+
Non-trainable params: 0 (0.00 B)
|
| 48 |
+
|
| 49 |
+
Final accuracy (on validation data): 0.96
|
| 50 |
+
|
| 51 |
+
Evaluating on test data...
|
| 52 |
+
Accuracy on test data: 0.96
|
| 53 |
+
|
| 54 |
"""
|
| 55 |
|
| 56 |
import glob
|