mnist_cnn.py 基本上就是最简单的一个卷积神经网络了,其结构如下:
________________________________________________________________________________
Layer (type) Output Shape Param #
================================================================================
conv2d_1 (Conv2D) (None, 26, 26, 32) 320
________________________________________________________________________________
conv2d_2 (Conv2D) (None, 24, 24, 64) 18496
________________________________________________________________________________
max_pooling2d_1 (MaxPooling2D) (None, 12, 12, 64) 0
________________________________________________________________________________
dropout_1 (Dropout) (None, 12, 12, 64) 0
________________________________________________________________________________
flatten_1 (Flatten) (None, 9216) 0
________________________________________________________________________________
dense_1 (Dense) (None, 128) 1179776
________________________________________________________________________________
dropout_2 (Dropout) (None, 128) 0
________________________________________________________________________________
dense_2 (Dense) (None, 10) 1290
================================================================================
Total params: 1,199,882
Trainable params: 1,199,882
Non-trainable params: 0
________________________________________________________________________________
不再过多解释
另一个更简单的网络结构为 mnist_mlp.py,即 多层感知器(MLP,Multilayer Perceptron)
__________________________________________________
Layer (type) Output Shape Param #
==================================================
dense_1 (Dense) (None, 512) 401920
__________________________________________________
dropout_1 (Dropout) (None, 512) 0
__________________________________________________
dense_2 (Dense) (None, 512) 262656
__________________________________________________
dropout_2 (Dropout) (None, 512) 0
__________________________________________________
dense_3 (Dense) (None, 10) 5130
==================================================
Total params: 669,706
Trainable params: 669,706
Non-trainable params: 0
__________________________________________________
用全连接堆叠起来的图像识别
——————————————————————
总目录