mnist_cnn
1 | # -*- coding: utf8 -*- |
训练过程1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33x_train shape: (60000, 28, 28, 1)
60000 train samples
10000 test samples
Train on 60000 samples, validate on 10000 samples
Epoch 1/12
- 248s - loss: 0.2778 - acc: 0.9140 - val_loss: 0.0612 - val_acc: 0.9800
Epoch 2/12
- 219s - loss: 0.0982 - acc: 0.9708 - val_loss: 0.0433 - val_acc: 0.9857
Epoch 3/12
- 212s - loss: 0.0766 - acc: 0.9776 - val_loss: 0.0354 - val_acc: 0.9876
Epoch 4/12
- 226s - loss: 0.0653 - acc: 0.9806 - val_loss: 0.0342 - val_acc: 0.9879
Epoch 5/12
- 221s - loss: 0.0573 - acc: 0.9828 - val_loss: 0.0307 - val_acc: 0.9896
Epoch 6/12
- 230s - loss: 0.0539 - acc: 0.9834 - val_loss: 0.0286 - val_acc: 0.9907
Epoch 7/12
- 224s - loss: 0.0490 - acc: 0.9850 - val_loss: 0.0280 - val_acc: 0.9901
Epoch 8/12
- 229s - loss: 0.0475 - acc: 0.9856 - val_loss: 0.0300 - val_acc: 0.9904
Epoch 9/12
- 249s - loss: 0.0465 - acc: 0.9862 - val_loss: 0.0286 - val_acc: 0.9906
Epoch 10/12
- 257s - loss: 0.0423 - acc: 0.9866 - val_loss: 0.0261 - val_acc: 0.9910
Epoch 11/12
- 243s - loss: 0.0393 - acc: 0.9883 - val_loss: 0.0313 - val_acc: 0.9903
Epoch 12/12
- 277s - loss: 0.0413 - acc: 0.9877 - val_loss: 0.0266 - val_acc: 0.9907
Test loss: 0.026646837043244158
Test Accuracy: 0.9907
Process finished with exit code 0
如果是第一次运行,会从 https://s3.amazonaws.com/img-datasets/mnist.npz 下载数据集,Windows会存放在c://Users//<User name>//.keras/datasets
下面;Linux会存放在home/.keras/datasets
下面。
cifar10_cnn.py
1 |
训练过程