我查看了来自 Keras 的以下示例:
MNIST 中的 MLP:https : //github.com/fchollet/keras/blob/master/examples/mnist_mlp.py
MNIST 中的 CNN:https : //github.com/fchollet/keras/blob/master/examples/mnist_cnn.py
我在 CPU 上的 Theano 中运行两者。在 MLP 中,我每个 epoch的平均时间约为16秒,共有 669,706 个参数:
Layer (type) Output Shape Param #
=================================================================
dense_33 (Dense) (None, 512) 401920
_________________________________________________________________
dropout_16 (Dropout) (None, 512) 0
_________________________________________________________________
dense_34 (Dense) (None, 512) 262656
_________________________________________________________________
dropout_17 (Dropout) (None, 512) 0
_________________________________________________________________
dense_35 (Dense) (None, 10) 5130
=================================================================
Total params: 669,706.0
Trainable params: 669,706.0
Non-trainable params: 0.0
Run Code Online (Sandbox Code Playgroud)
在 CNN 中,我从原始代码中 …