MNIST数据集是机器学习领域中非常经典的一个数据集,由60000个训练样本和10000个测试样本组成,每个样本都是一张28 * 28像素的灰度手写数字图片。
我们把60000个训练样本分成两部分,前5000个为验证样本,后55000为训练样本。代码基本与Tensorflow官方一致,完整代码如下:(TensorFlow版本: 1.14.0,其它版本或许有差异)
#!/usr/bin/env python
import os
import tensorflow as tf
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
tf.compat.v1.enable_eager_execution()
print("TensorFlow Version:\t", tf.__version__)
mnist = tf.keras.datasets.mnist
(x_train_all, y_train_all), (x_test, y_test) = mnist.load_data()
x_train_all, x_test = x_train_all / 255.0, x_test / 255.0
x_valid, x_train = x_train_all[:5000], x_train_all[5000:]
y_valid, y_train = y_train_all[:5000], y_train_all[5000:]
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Flatten(input_shape=(28, 28)))
model.add(tf.keras.layers.Dense(128, activation='relu'))
model.add(tf.keras.layers.Dropout(0.2))
model.add(tf.keras.layers.Dense(10, activation='softmax'))
model.compile(optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy'],)
model.fit(x_train, y_train, epochs=5, validation_data=(x_valid, y_valid))
model.evaluate(x_test, y_test)
输出结果如下:
"C:\Program Files\Python\Python37\python.exe" "D:/Pycharm Projects/MLDemo/MLDemo.py"
TensorFlow Version: 1.14.0
Train on 55000 samples, validate on 5000 samples
Epoch 1/5
32/55000 [..............................] - ETA: 2:58 - loss: 2.4444 - acc: 0.1250
1056/55000 [..............................] - ETA: 7s - loss: 1.6515 - acc: 0.4848
2080/55000 [>.............................] - ETA: 5s - loss: 1.2406 - acc: 0.6192
3104/55000 [>.............................] - ETA: 4s - loss: 1.0329 - acc: 0.6811
4192/55000 [=>............................] - ETA: 3s - loss: 0.9097 - acc: 0.7240
5216/55000 [=>............................] - ETA: 3s - loss: 0.8194 - acc: 0.7510
6240/55000 [==>...........................] - ETA: 3s - loss: 0.7554 - acc: 0.7708
7168/55000 [==>...........................] - ETA: 3s - loss: 0.7100 - acc: 0.7846
8288/55000 [===>..........................] - ETA: 2s - loss: 0.6664 - acc: 0.7986
9376/55000 [====>.........................] - ETA: 2s - loss: 0.6278 - acc: 0.8104
10528/55000 [====>.........................] - ETA: 2s - loss: 0.6004 - acc: 0.8181
11584/55000 [=====>........................] - ETA: 2s - loss: 0.5733 - acc: 0.8266
12672/55000 [=====>........................] - ETA: 2s - loss: 0.5568 - acc: 0.8320
13792/55000 [======>.......................] - ETA: 2s - loss: 0.5393 - acc: 0.8381
14912/55000 [=======>......................] - ETA: 2s - loss: 0.5257 - acc: 0.8425
15904/55000 [=======>......................] - ETA: 2s - loss: 0.5144 - acc: 0.8462
16928/55000 [========>.....................] - ETA: 2s - loss: 0.5006 - acc: 0.8506
18048/55000 [========>.....................] - ETA: 1s - loss: 0.4886 - acc: 0.8543
19200/55000 [=========>....................] - ETA: 1s - loss: 0.4773 - acc: 0.8573
20256/55000 [==========>...................] - ETA: 1s - loss: 0.4660 - acc: 0.8609
21344/55000 [==========>...................] - ETA: 1s - loss: 0.4550 - acc: 0.8639
22464/55000 [===========>..................] - ETA: 1s - loss: 0.4442 - acc: 0.8674
23584/55000 [===========>..................] - ETA: 1s - loss: 0.4363 - acc: 0.8698
24608/55000 [============>.................] - ETA: 1s - loss: 0.4298 - acc: 0.8717
25696/55000 [=============>................] - ETA: 1s - loss: 0.4223 - acc: 0.8742
26816/55000 [=============>................] - ETA: 1s - loss: 0.4147 - acc: 0.8764
27968/55000 [==============>...............] - ETA: 1s - loss: 0.4070 - acc: 0.8784
29120/55000 [==============>...............] - ETA: 1s - loss: 0.4006 - acc: 0.8805
30240/55000 [===============>..............] - ETA: 1s - loss: 0.3949 - acc: 0.8824
31360/55000 [================>.............] - ETA: 1s - loss: 0.3903 - acc: 0.8838
32512/55000 [================>.............] - ETA: 1s - loss: 0.3842 - acc: 0.8858
33696/55000 [=================>............] - ETA: 1s - loss: 0.3797 - acc: 0.8872
34720/55000 [=================>............] - ETA: 1s - loss: 0.3743 - acc: 0.8886
35776/55000 [==================>...........] - ETA: 0s - loss: 0.3699 - acc: 0.8900
36864/55000 [===================>..........] - ETA: 0s - loss: 0.3651 - acc: 0.8914
38016/55000 [===================>..........] - ETA: 0s - loss: 0.3604 - acc: 0.8928
39136/55000 [====================>.........] - ETA: 0s - loss: 0.3563 - acc: 0.8940
40192/55000 [====================>.........] - ETA: 0s - loss: 0.3526 - acc: 0.8951
41248/55000 [=====================>........] - ETA: 0s - loss: 0.3492 - acc: 0.8962
42400/55000 [======================>.......] - ETA: 0s - loss: 0.3460 - acc: 0.8973
43488/55000 [======================>.......] - ETA: 0s - loss: 0.3423 - acc: 0.8984
44512/55000 [=======================>......] - ETA: 0s - loss: 0.3395 - acc: 0.8993
45440/55000 [=======================>......] - ETA: 0s - loss: 0.3365 - acc: 0.9002
46528/55000 [========================>.....] - ETA: 0s - loss: 0.3335 - acc: 0.9008
47648/55000 [========================>.....] - ETA: 0s - loss: 0.3307 - acc: 0.9017
48736/55000 [=========================>....] - ETA: 0s - loss: 0.3278 - acc: 0.9027
49856/55000 [==========================>...] - ETA: 0s - loss: 0.3252 - acc: 0.9035
50944/55000 [==========================>...] - ETA: 0s - loss: 0.3221 - acc: 0.9045
51968/55000 [===========================>..] - ETA: 0s - loss: 0.3199 - acc: 0.9051
53088/55000 [===========================>..] - ETA: 0s - loss: 0.3176 - acc: 0.9059
54112/55000 [============================>.] - ETA: 0s - loss: 0.3152 - acc: 0.9066
55000/55000 [==============================] - 3s 55us/sample - loss: 0.3129 - acc: 0.9072 - val_loss: 0.1477 - val_acc: 0.9608
Epoch 2/5
32/55000 [..............................] - ETA: 8s - loss: 0.3416 - acc: 0.8750
1088/55000 [..............................] - ETA: 2s - loss: 0.2193 - acc: 0.9366
2144/55000 [>.............................] - ETA: 2s - loss: 0.1951 - acc: 0.9459
3200/55000 [>.............................] - ETA: 2s - loss: 0.1856 - acc: 0.9491
4320/55000 [=>............................] - ETA: 2s - loss: 0.1806 - acc: 0.9488
5376/55000 [=>............................] - ETA: 2s - loss: 0.1830 - acc: 0.9488
6432/55000 [==>...........................] - ETA: 2s - loss: 0.1749 - acc: 0.9496
7584/55000 [===>..........................] - ETA: 2s - loss: 0.1707 - acc: 0.9499
8736/55000 [===>..........................] - ETA: 2s - loss: 0.1692 - acc: 0.9497
9792/55000 [====>.........................] - ETA: 2s - loss: 0.1684 - acc: 0.9504
10944/55000 [====>.........................] - ETA: 2s - loss: 0.1671 - acc: 0.9501
12096/55000 [=====>........................] - ETA: 2s - loss: 0.1670 - acc: 0.9506
13248/55000 [======>.......................] - ETA: 1s - loss: 0.1670 - acc: 0.9505
14432/55000 [======>.......................] - ETA: 1s - loss: 0.1661 - acc: 0.9504
15552/55000 [=======>......................] - ETA: 1s - loss: 0.1682 - acc: 0.9500
16672/55000 [========>.....................] - ETA: 1s - loss: 0.1671 - acc: 0.9507
17760/55000 [========>.....................] - ETA: 1s - loss: 0.1675 - acc: 0.9505
18912/55000 [=========>....................] - ETA: 1s - loss: 0.1660 - acc: 0.9510
19968/55000 [=========>....................] - ETA: 1s - loss: 0.1662 - acc: 0.9510
21120/55000 [==========>...................] - ETA: 1s - loss: 0.1653 - acc: 0.9510
22272/55000 [===========>..................] - ETA: 1s - loss: 0.1640 - acc: 0.9517
23424/55000 [===========>..................] - ETA: 1s - loss: 0.1633 - acc: 0.9523
24544/55000 [============>.................] - ETA: 1s - loss: 0.1625 - acc: 0.9527
25664/55000 [============>.................] - ETA: 1s - loss: 0.1620 - acc: 0.9530
26688/55000 [=============>................] - ETA: 1s - loss: 0.1619 - acc: 0.9530
27840/55000 [==============>...............] - ETA: 1s - loss: 0.1611 - acc: 0.9531
28960/55000 [==============>...............] - ETA: 1s - loss: 0.1620 - acc: 0.9529
30080/55000 [===============>..............] - ETA: 1s - loss: 0.1619 - acc: 0.9527
31232/55000 [================>.............] - ETA: 1s - loss: 0.1610 - acc: 0.9529
32384/55000 [================>.............] - ETA: 1s - loss: 0.1605 - acc: 0.9528
33472/55000 [=================>............] - ETA: 0s - loss: 0.1595 - acc: 0.9532
34592/55000 [=================>............] - ETA: 0s - loss: 0.1589 - acc: 0.9533
35744/55000 [==================>...........] - ETA: 0s - loss: 0.1588 - acc: 0.9534
36896/55000 [===================>..........] - ETA: 0s - loss: 0.1587 - acc: 0.9534
38016/55000 [===================>..........] - ETA: 0s - loss: 0.1575 - acc: 0.9537
39104/55000 [====================>.........] - ETA: 0s - loss: 0.1566 - acc: 0.9539
40256/55000 [====================>.........] - ETA: 0s - loss: 0.1561 - acc: 0.9541
41376/55000 [=====================>........] - ETA: 0s - loss: 0.1562 - acc: 0.9541
42496/55000 [======================>.......] - ETA: 0s - loss: 0.1555 - acc: 0.9542
43648/55000 [======================>.......] - ETA: 0s - loss: 0.1545 - acc: 0.9543
44800/55000 [=======================>......] - ETA: 0s - loss: 0.1539 - acc: 0.9543
45952/55000 [========================>.....] - ETA: 0s - loss: 0.1537 - acc: 0.9544
47072/55000 [========================>.....] - ETA: 0s - loss: 0.1532 - acc: 0.9545
48192/55000 [=========================>....] - ETA: 0s - loss: 0.1526 - acc: 0.9548
49184/55000 [=========================>....] - ETA: 0s - loss: 0.1528 - acc: 0.9548
50336/55000 [==========================>...] - ETA: 0s - loss: 0.1522 - acc: 0.9550
51424/55000 [===========================>..] - ETA: 0s - loss: 0.1521 - acc: 0.9551
52544/55000 [===========================>..] - ETA: 0s - loss: 0.1521 - acc: 0.9549
53696/55000 [============================>.] - ETA: 0s - loss: 0.1516 - acc: 0.9550
54848/55000 [============================>.] - ETA: 0s - loss: 0.1510 - acc: 0.9551
55000/55000 [==============================] - 3s 48us/sample - loss: 0.1512 - acc: 0.9551 - val_loss: 0.1084 - val_acc: 0.9680
Epoch 3/5
32/55000 [..............................] - ETA: 6s - loss: 0.0403 - acc: 1.0000
1184/55000 [..............................] - ETA: 2s - loss: 0.1262 - acc: 0.9654
2304/55000 [>.............................] - ETA: 2s - loss: 0.1259 - acc: 0.9661
3392/55000 [>.............................] - ETA: 2s - loss: 0.1216 - acc: 0.9652
4544/55000 [=>............................] - ETA: 2s - loss: 0.1202 - acc: 0.9650
5696/55000 [==>...........................] - ETA: 2s - loss: 0.1192 - acc: 0.9631
6880/55000 [==>...........................] - ETA: 2s - loss: 0.1125 - acc: 0.9658
8000/55000 [===>..........................] - ETA: 2s - loss: 0.1099 - acc: 0.9665
9152/55000 [===>..........................] - ETA: 2s - loss: 0.1088 - acc: 0.9667
10304/55000 [====>.........................] - ETA: 2s - loss: 0.1080 - acc: 0.9664
11488/55000 [=====>........................] - ETA: 1s - loss: 0.1066 - acc: 0.9672
12576/55000 [=====>........................] - ETA: 1s - loss: 0.1069 - acc: 0.9676
13696/55000 [======>.......................] - ETA: 1s - loss: 0.1061 - acc: 0.9678
14848/55000 [=======>......................] - ETA: 1s - loss: 0.1069 - acc: 0.9670
16000/55000 [=======>......................] - ETA: 1s - loss: 0.1075 - acc: 0.9668
17120/55000 [========>.....................] - ETA: 1s - loss: 0.1084 - acc: 0.9661
18240/55000 [========>.....................] - ETA: 1s - loss: 0.1079 - acc: 0.9663
19392/55000 [=========>....................] - ETA: 1s - loss: 0.1081 - acc: 0.9663
20544/55000 [==========>...................] - ETA: 1s - loss: 0.1076 - acc: 0.9667
21696/55000 [==========>...................] - ETA: 1s - loss: 0.1069 - acc: 0.9669
22816/55000 [===========>..................] - ETA: 1s - loss: 0.1070 - acc: 0.9669
24000/55000 [============>.................] - ETA: 1s - loss: 0.1079 - acc: 0.9667
25152/55000 [============>.................] - ETA: 1s - loss: 0.1079 - acc: 0.9671
26272/55000 [=============>................] - ETA: 1s - loss: 0.1083 - acc: 0.9670
27392/55000 [=============>................] - ETA: 1s - loss: 0.1093 - acc: 0.9667
28576/55000 [==============>...............] - ETA: 1s - loss: 0.1100 - acc: 0.9667
29760/55000 [===============>..............] - ETA: 1s - loss: 0.1096 - acc: 0.9668
30880/55000 [===============>..............] - ETA: 1s - loss: 0.1096 - acc: 0.9669
32000/55000 [================>.............] - ETA: 1s - loss: 0.1102 - acc: 0.9667
33120/55000 [=================>............] - ETA: 0s - loss: 0.1100 - acc: 0.9668
34240/55000 [=================>............] - ETA: 0s - loss: 0.1101 - acc: 0.9669
35200/55000 [==================>...........] - ETA: 0s - loss: 0.1100 - acc: 0.9668
36352/55000 [==================>...........] - ETA: 0s - loss: 0.1103 - acc: 0.9667
37472/55000 [===================>..........] - ETA: 0s - loss: 0.1104 - acc: 0.9666
38624/55000 [====================>.........] - ETA: 0s - loss: 0.1104 - acc: 0.9668
39776/55000 [====================>.........] - ETA: 0s - loss: 0.1105 - acc: 0.9668
40896/55000 [=====================>........] - ETA: 0s - loss: 0.1108 - acc: 0.9668
42016/55000 [=====================>........] - ETA: 0s - loss: 0.1106 - acc: 0.9670
43168/55000 [======================>.......] - ETA: 0s - loss: 0.1098 - acc: 0.9672
44320/55000 [=======================>......] - ETA: 0s - loss: 0.1104 - acc: 0.9671
45440/55000 [=======================>......] - ETA: 0s - loss: 0.1109 - acc: 0.9669
46496/55000 [========================>.....] - ETA: 0s - loss: 0.1109 - acc: 0.9669
47648/55000 [========================>.....] - ETA: 0s - loss: 0.1109 - acc: 0.9668
48800/55000 [=========================>....] - ETA: 0s - loss: 0.1109 - acc: 0.9668
49920/55000 [==========================>...] - ETA: 0s - loss: 0.1107 - acc: 0.9669
51040/55000 [==========================>...] - ETA: 0s - loss: 0.1111 - acc: 0.9667
52192/55000 [===========================>..] - ETA: 0s - loss: 0.1116 - acc: 0.9665
53344/55000 [============================>.] - ETA: 0s - loss: 0.1115 - acc: 0.9665
54464/55000 [============================>.] - ETA: 0s - loss: 0.1119 - acc: 0.9665
55000/55000 [==============================] - 3s 47us/sample - loss: 0.1119 - acc: 0.9664 - val_loss: 0.0966 - val_acc: 0.9714
Epoch 4/5
32/55000 [..............................] - ETA: 5s - loss: 0.0525 - acc: 0.9688
1184/55000 [..............................] - ETA: 2s - loss: 0.1083 - acc: 0.9645
2240/55000 [>.............................] - ETA: 2s - loss: 0.0960 - acc: 0.9692
3360/55000 [>.............................] - ETA: 2s - loss: 0.1016 - acc: 0.9685
4512/55000 [=>............................] - ETA: 2s - loss: 0.1044 - acc: 0.9694
5632/55000 [==>...........................] - ETA: 2s - loss: 0.0989 - acc: 0.9714
6720/55000 [==>...........................] - ETA: 2s - loss: 0.0991 - acc: 0.9707
7840/55000 [===>..........................] - ETA: 2s - loss: 0.1021 - acc: 0.9694
8992/55000 [===>..........................] - ETA: 2s - loss: 0.1013 - acc: 0.9694
10144/55000 [====>.........................] - ETA: 2s - loss: 0.1003 - acc: 0.9688
11168/55000 [=====>........................] - ETA: 2s - loss: 0.1003 - acc: 0.9680
12288/55000 [=====>........................] - ETA: 1s - loss: 0.0979 - acc: 0.9690
13408/55000 [======>.......................] - ETA: 1s - loss: 0.0965 - acc: 0.9699
14592/55000 [======>.......................] - ETA: 1s - loss: 0.0944 - acc: 0.9706
15744/55000 [=======>......................] - ETA: 1s - loss: 0.0940 - acc: 0.9708
16864/55000 [========>.....................] - ETA: 1s - loss: 0.0930 - acc: 0.9709
17984/55000 [========>.....................] - ETA: 1s - loss: 0.0929 - acc: 0.9710
19136/55000 [=========>....................] - ETA: 1s - loss: 0.0930 - acc: 0.9712
20288/55000 [==========>...................] - ETA: 1s - loss: 0.0928 - acc: 0.9713
21376/55000 [==========>...................] - ETA: 1s - loss: 0.0935 - acc: 0.9710
22464/55000 [===========>..................] - ETA: 1s - loss: 0.0929 - acc: 0.9712
23520/55000 [===========>..................] - ETA: 1s - loss: 0.0948 - acc: 0.9708
24576/55000 [============>.................] - ETA: 1s - loss: 0.0941 - acc: 0.9709
25632/55000 [============>.................] - ETA: 1s - loss: 0.0930 - acc: 0.9712
26784/55000 [=============>................] - ETA: 1s - loss: 0.0927 - acc: 0.9712
27904/55000 [==============>...............] - ETA: 1s - loss: 0.0923 - acc: 0.9713
29056/55000 [==============>...............] - ETA: 1s - loss: 0.0935 - acc: 0.9711
30144/55000 [===============>..............] - ETA: 1s - loss: 0.0946 - acc: 0.9706
31232/55000 [================>.............] - ETA: 1s - loss: 0.0946 - acc: 0.9703
32352/55000 [================>.............] - ETA: 1s - loss: 0.0950 - acc: 0.9703
33504/55000 [=================>............] - ETA: 0s - loss: 0.0949 - acc: 0.9703
34624/55000 [=================>............] - ETA: 0s - loss: 0.0948 - acc: 0.9704
35744/55000 [==================>...........] - ETA: 0s - loss: 0.0941 - acc: 0.9705
36896/55000 [===================>..........] - ETA: 0s - loss: 0.0934 - acc: 0.9707
38016/55000 [===================>..........] - ETA: 0s - loss: 0.0930 - acc: 0.9710
39136/55000 [====================>.........] - ETA: 0s - loss: 0.0932 - acc: 0.9708
40256/55000 [====================>.........] - ETA: 0s - loss: 0.0932 - acc: 0.9710
41408/55000 [=====================>........] - ETA: 0s - loss: 0.0929 - acc: 0.9711
42560/55000 [======================>.......] - ETA: 0s - loss: 0.0927 - acc: 0.9712
43552/55000 [======================>.......] - ETA: 0s - loss: 0.0926 - acc: 0.9712
44672/55000 [=======================>......] - ETA: 0s - loss: 0.0930 - acc: 0.9711
45824/55000 [=======================>......] - ETA: 0s - loss: 0.0930 - acc: 0.9712
46944/55000 [========================>.....] - ETA: 0s - loss: 0.0928 - acc: 0.9712
48096/55000 [=========================>....] - ETA: 0s - loss: 0.0926 - acc: 0.9712
49216/55000 [=========================>....] - ETA: 0s - loss: 0.0923 - acc: 0.9714
50336/55000 [==========================>...] - ETA: 0s - loss: 0.0927 - acc: 0.9712
51392/55000 [===========================>..] - ETA: 0s - loss: 0.0925 - acc: 0.9712
52448/55000 [===========================>..] - ETA: 0s - loss: 0.0927 - acc: 0.9711
53536/55000 [============================>.] - ETA: 0s - loss: 0.0925 - acc: 0.9713
54688/55000 [============================>.] - ETA: 0s - loss: 0.0924 - acc: 0.9714
55000/55000 [==============================] - 3s 48us/sample - loss: 0.0924 - acc: 0.9714 - val_loss: 0.0799 - val_acc: 0.9770
Epoch 5/5
32/55000 [..............................] - ETA: 5s - loss: 0.1389 - acc: 0.9375
1088/55000 [..............................] - ETA: 2s - loss: 0.0770 - acc: 0.9715
2144/55000 [>.............................] - ETA: 2s - loss: 0.0785 - acc: 0.9748
3200/55000 [>.............................] - ETA: 2s - loss: 0.0706 - acc: 0.9775
4256/55000 [=>............................] - ETA: 2s - loss: 0.0716 - acc: 0.9777
5248/55000 [=>............................] - ETA: 2s - loss: 0.0713 - acc: 0.9777
6240/55000 [==>...........................] - ETA: 2s - loss: 0.0735 - acc: 0.9771
7296/55000 [==>...........................] - ETA: 2s - loss: 0.0732 - acc: 0.9775
8352/55000 [===>..........................] - ETA: 2s - loss: 0.0762 - acc: 0.9769
9408/55000 [====>.........................] - ETA: 2s - loss: 0.0772 - acc: 0.9760
10464/55000 [====>.........................] - ETA: 2s - loss: 0.0758 - acc: 0.9762
11552/55000 [=====>........................] - ETA: 2s - loss: 0.0755 - acc: 0.9759
12608/55000 [=====>........................] - ETA: 2s - loss: 0.0786 - acc: 0.9752
13664/55000 [======>.......................] - ETA: 2s - loss: 0.0776 - acc: 0.9755
14816/55000 [=======>......................] - ETA: 1s - loss: 0.0764 - acc: 0.9758
16000/55000 [=======>......................] - ETA: 1s - loss: 0.0765 - acc: 0.9756
17152/55000 [========>.....................] - ETA: 1s - loss: 0.0769 - acc: 0.9754
18240/55000 [========>.....................] - ETA: 1s - loss: 0.0776 - acc: 0.9753
19392/55000 [=========>....................] - ETA: 1s - loss: 0.0776 - acc: 0.9754
20576/55000 [==========>...................] - ETA: 1s - loss: 0.0779 - acc: 0.9753
21728/55000 [==========>...................] - ETA: 1s - loss: 0.0770 - acc: 0.9754
22784/55000 [===========>..................] - ETA: 1s - loss: 0.0773 - acc: 0.9754
23872/55000 [============>.................] - ETA: 1s - loss: 0.0773 - acc: 0.9755
24992/55000 [============>.................] - ETA: 1s - loss: 0.0775 - acc: 0.9755
26080/55000 [=============>................] - ETA: 1s - loss: 0.0773 - acc: 0.9757
27008/55000 [=============>................] - ETA: 1s - loss: 0.0773 - acc: 0.9755
27872/55000 [==============>...............] - ETA: 1s - loss: 0.0783 - acc: 0.9752
28960/55000 [==============>...............] - ETA: 1s - loss: 0.0789 - acc: 0.9750
29984/55000 [===============>..............] - ETA: 1s - loss: 0.0801 - acc: 0.9744
30592/55000 [===============>..............] - ETA: 1s - loss: 0.0797 - acc: 0.9745
31136/55000 [===============>..............] - ETA: 1s - loss: 0.0795 - acc: 0.9744
32032/55000 [================>.............] - ETA: 1s - loss: 0.0794 - acc: 0.9744
33024/55000 [=================>............] - ETA: 1s - loss: 0.0793 - acc: 0.9745
34080/55000 [=================>............] - ETA: 1s - loss: 0.0789 - acc: 0.9748
35200/55000 [==================>...........] - ETA: 0s - loss: 0.0785 - acc: 0.9749
36256/55000 [==================>...........] - ETA: 0s - loss: 0.0790 - acc: 0.9746
37440/55000 [===================>..........] - ETA: 0s - loss: 0.0785 - acc: 0.9749
38496/55000 [===================>..........] - ETA: 0s - loss: 0.0784 - acc: 0.9749
39552/55000 [====================>.........] - ETA: 0s - loss: 0.0785 - acc: 0.9749
40608/55000 [=====================>........] - ETA: 0s - loss: 0.0786 - acc: 0.9749
41696/55000 [=====================>........] - ETA: 0s - loss: 0.0785 - acc: 0.9749
42816/55000 [======================>.......] - ETA: 0s - loss: 0.0782 - acc: 0.9749
43904/55000 [======================>.......] - ETA: 0s - loss: 0.0776 - acc: 0.9750
44960/55000 [=======================>......] - ETA: 0s - loss: 0.0775 - acc: 0.9750
46048/55000 [========================>.....] - ETA: 0s - loss: 0.0771 - acc: 0.9752
47136/55000 [========================>.....] - ETA: 0s - loss: 0.0772 - acc: 0.9752
48224/55000 [=========================>....] - ETA: 0s - loss: 0.0770 - acc: 0.9753
49248/55000 [=========================>....] - ETA: 0s - loss: 0.0770 - acc: 0.9754
50272/55000 [==========================>...] - ETA: 0s - loss: 0.0769 - acc: 0.9754
51232/55000 [==========================>...] - ETA: 0s - loss: 0.0771 - acc: 0.9753
52192/55000 [===========================>..] - ETA: 0s - loss: 0.0770 - acc: 0.9754
52992/55000 [===========================>..] - ETA: 0s - loss: 0.0771 - acc: 0.9753
53568/55000 [============================>.] - ETA: 0s - loss: 0.0771 - acc: 0.9754
54496/55000 [============================>.] - ETA: 0s - loss: 0.0772 - acc: 0.9752
55000/55000 [==============================] - 3s 52us/sample - loss: 0.0773 - acc: 0.9752 - val_loss: 0.0723 - val_acc: 0.9788
32/10000 [..............................] - ETA: 0s - loss: 0.0410 - acc: 0.9688
2496/10000 [======>.......................] - ETA: 0s - loss: 0.1088 - acc: 0.9671
5280/10000 [==============>...............] - ETA: 0s - loss: 0.0977 - acc: 0.9705
7936/10000 [======================>.......] - ETA: 0s - loss: 0.0810 - acc: 0.9757
10000/10000 [==============================] - 0s 22us/sample - loss: 0.0756 - acc: 0.9776
Process finished with exit code 0
准确率达到97.76%,还是相当不错的吧。至此,深度学习之“Hello World”示例完毕~~~