使用Python的Keras库来学习深度学习中的 “Hello World” ------ Mnist。
Mnist是机器学习领域里的一个经典数据集,这个数据集包含60000张训练图像和10000张测试图像。
mnist手写数字识别
用以下代码来实现mnist的网络并训练测试
注:通过**(train_images,train_labels),(test_images,test_labels) = mnist.load_data()**来导入mnist数据集,是通过网址的方式来下载数据集,可是这个网址是外网,需要翻墙。
from keras.datasets import mnist
from keras import models
from keras import layers
from keras.utils import to_categorical
(train_images,train_labels),(test_images,test_labels) = mnist.load_data()
network = models.Sequential()
network.add(layers.Dense(512,activation='relu',input_shape=(28*28,)))
network.add(layers.Dense(10,activation='softmax'))
network.compile(optimizer='rmsprop',
loss='categorical_crossentropy',
metrics=['accuracy'])
train_images = train_images.reshape((60000,28 * 28))
train_images = train_images.astype('float32') / 255
test_images = test_images.reshape((10000,28 * 28))
test_images = test_images.astype('float32') / 255
train_labels = to_categorical(train_labels)
test_labels = to_categorical(test_labels)
#开始训练网络
network.fit(train_images,train_labels,epochs=5,batch_size=128)
#检查模型在测试集上的性能
test_loss,test_acc = network.evaluate(test_images,test_labels)
print('test_acc:',test_acc)
下面显示运行结果,训练过程中显示了两个数字:loss(损失)和acc(准确率),一个epoch表示所有训练样本运算学习一遍。可以看到最终的准确率达到了0.9891。最下面一组显示了用测试集测试的结果,10000张图片的准确率为0.9808。
Using TensorFlow backend.
Epoch 1/5
2018-10-12 21:06:38.599707: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
128/60000 [..............................] - ETA: 1:23 - loss: 2.3651 - acc: 0.0703
1024/60000 [..............................] - ETA: 13s - loss: 1.3802 - acc: 0.5850
1920/60000 [..............................] - ETA: 8s - loss: 1.0771 - acc: 0.6906
2816/60000 [>.............................] - ETA: 7s - loss: 0.9057 - acc: 0.7436
3712/60000 [>.............................] - ETA: 6s - loss: 0.8109 - acc: 0.7689
4608/60000 [=>............................] - ETA: 5s - loss: 0.7271 - acc: 0.7925
5504/60000 [=>............................] - ETA: 5s - loss: 0.6819 - acc: 0.8056
6400/60000 [==>...........................] - ETA: 4s - loss: 0.6355 - acc: 0.8187
7296/60000 [==>...........................] - ETA: 4s - loss: 0.6053 - acc: 0.8273
8192/60000 [===>..........................] - ETA: 4s - loss: 0.5708 - acc: 0.8378
9088/60000 [===>..........................] - ETA: 4s - loss: 0.5488 - acc: 0.8446
9984/60000 [===>..........................] - ETA: 3s - loss: 0.5305 - acc: 0.8498
10880/60000 [====>.........................] - ETA: 3s - loss: 0.5148 - acc: 0.8537
11776/60000 [====>.........................] - ETA: 3s - loss: 0.4999 - acc: 0.8578
12672/60000 [=====>........................] - ETA: 3s - loss: 0.4871 - acc: 0.8612
13440/60000 [=====>........................] - ETA: 3s - loss: 0.4742 - acc: 0.8649
14208/60000 [======>.......................] - ETA: 3s - loss: 0.4654 - acc: 0.8670
14976/60000 [======>.......................] - ETA: 3s - loss: 0.4554 - acc: 0.8698
15872/60000 [======>.......................] - ETA: 3s - loss: 0.4439 - acc: 0.8732
16768/60000 [=======>......................] - ETA: 3s - loss: 0.4360 - acc: 0.8752
17664/60000 [=======>......................] - ETA: 3s - loss: 0.4291 - acc: 0.8774
18560/60000 [========>.....................] - ETA: 2s - loss: 0.4209 - acc: 0.8794
19456/60000 [========>.....................] - ETA: 2s - loss: 0.4116 - acc: 0.8822
20352/60000 [=========>....................] - ETA: 2s - loss: 0.4041 - acc: 0.8842
21248/60000 [=========>....................] - ETA: 2s - loss: 0.3980 - acc: 0.8864
22016/60000 [==========>...................] - ETA: 2s - loss: 0.3921 - acc: 0.8879
22784/60000 [==========>...................] - ETA: 2s - loss: 0.3862 - acc: 0.8896
23552/60000 [==========>...................] - ETA: 2s - loss: 0.3813 - acc: 0.8909
24448/60000 [===========>..................] - ETA: 2s - loss: 0.3761 - acc: 0.8923
25344/60000 [===========>..................] - ETA: 2s - loss: 0.3746 - acc: 0.8928
26240/60000 [============>.................] - ETA: 2s - loss: 0.3688 - acc: 0.8943
27136/60000 [============>.................] - ETA: 2s - loss: 0.3627 - acc: 0.8962
28032/60000 [=============>................] - ETA: 2s - loss: 0.3578 - acc: 0.8975
28928/60000 [=============>................] - ETA: 2s - loss: 0.3534 - acc: 0.8986
29824/60000 [=============>................] - ETA: 2s - loss: 0.3499 - acc: 0.8997
30720/60000 [==============>...............] - ETA: 2s - loss: 0.3456 - acc: 0.9009
31616/60000 [==============>...............] - ETA: 1s - loss: 0.3416 - acc: 0.9021
32512/60000 [===============>..............] - ETA: 1s - loss: 0.3368 - acc: 0.9034
33408/60000 [===============>..............] - ETA: 1s - loss: 0.3333 - acc: 0.9042
34304/60000 [================>.............] - ETA: 1s - loss: 0.3307 - acc: 0.9051
35200/60000 [================>.............] - ETA: 1s - loss: 0.3262 - acc: 0.9062
36096/60000 [=================>............] - ETA: 1s - loss: 0.3235 - acc: 0.9070
36992/60000 [=================>............] - ETA: 1s - loss: 0.3203 - acc: 0.9081
37888/60000 [=================>............] - ETA: 1s - loss: 0.3167 - acc: 0.9090
38784/60000 [==================>...........] - ETA: 1s - loss: 0.3127 - acc: 0.9102
39680/60000 [==================>...........] - ETA: 1s - loss: 0.3089 - acc: 0.9112
40576/60000 [===================>..........] - ETA: 1s - loss: 0.3068 - acc: 0.9117
41472/60000 [===================>..........] - ETA: 1s - loss: 0.3033 - acc: 0.9128
42368/60000 [====================>.........] - ETA: 1s - loss: 0.3000 - acc: 0.9138
43264/60000 [====================>.........] - ETA: 1s - loss: 0.2972 - acc: 0.9146
44032/60000 [=====================>........] - ETA: 1s - loss: 0.2949 - acc: 0.9154
44800/60000 [=====================>........] - ETA: 1s - loss: 0.2928 - acc: 0.9159
45696/60000 [=====================>........] - ETA: 0s - loss: 0.2904 - acc: 0.9164
46592/60000 [======================>.......] - ETA: 0s - loss: 0.2878 - acc: 0.9171
47488/60000 [======================>.......] - ETA: 0s - loss: 0.2858 - acc: 0.9175
48256/60000 [=======================>......] - ETA: 0s - loss: 0.2836 - acc: 0.9180
49152/60000 [=======================>......] - ETA: 0s - loss: 0.2812 - acc: 0.9188
50048/60000 [========================>.....] - ETA: 0s - loss: 0.2788 - acc: 0.9194
50944/60000 [========================>.....] - ETA: 0s - loss: 0.2770 - acc: 0.9200
51840/60000 [========================>.....] - ETA: 0s - loss: 0.2752 - acc: 0.9205
52736/60000 [=========================>....] - ETA: 0s - loss: 0.2741 - acc: 0.9208
53632/60000 [=========================>....] - ETA: 0s - loss: 0.2721 - acc: 0.9215
54528/60000 [==========================>...] - ETA: 0s - loss: 0.2695 - acc: 0.9222
55424/60000 [==========================>...] - ETA: 0s - loss: 0.2675 - acc: 0.9227
56320/60000 [===========================>..] - ETA: 0s - loss: 0.2651 - acc: 0.9234
57216/60000 [===========================>..] - ETA: 0s - loss: 0.2633 - acc: 0.9240
58112/60000 [============================>.] - ETA: 0s - loss: 0.2615 - acc: 0.9245
59008/60000 [============================>.] - ETA: 0s - loss: 0.2598 - acc: 0.9249
59904/60000 [============================>.] - ETA: 0s - loss: 0.2581 - acc: 0.9254
60000/60000 [==============================] - 4s 65us/step - loss: 0.2579 - acc: 0.9255
Epoch 2/5
128/60000 [..............................] - ETA: 4s - loss: 0.1088 - acc: 0.9688
1024/60000 [..............................] - ETA: 3s - loss: 0.1040 - acc: 0.9736
1792/60000 [..............................] - ETA: 3s - loss: 0.1255 - acc: 0.9699
2688/60000 [>.............................] - ETA: 3s - loss: 0.1264 - acc: 0.9665
3584/60000 [>.............................] - ETA: 3s - loss: 0.1265 - acc: 0.9660
4480/60000 [=>............................] - ETA: 3s - loss: 0.1217 - acc: 0.9665
5376/60000 [=>............................] - ETA: 3s - loss: 0.1199 - acc: 0.9648
6272/60000 [==>...........................] - ETA: 3s - loss: 0.1181 - acc: 0.9659
7168/60000 [==>...........................] - ETA: 3s - loss: 0.1211 - acc: 0.9653
8064/60000 [===>..........................] - ETA: 3s - loss: 0.1220 - acc: 0.9652
8960/60000 [===>..........................] - ETA: 3s - loss: 0.1207 - acc: 0.9655
9600/60000 [===>..........................] - ETA: 3s - loss: 0.1203 - acc: 0.9654
10368/60000 [====>.........................] - ETA: 3s - loss: 0.1226 - acc: 0.9643
11264/60000 [====>.........................] - ETA: 3s - loss: 0.1213 - acc: 0.9645
12160/60000 [=====>........................] - ETA: 3s - loss: 0.1220 - acc: 0.9643
13056/60000 [=====>........................] - ETA: 3s - loss: 0.1212 - acc: 0.9647
13952/60000 [=====>........................] - ETA: 2s - loss: 0.1206 - acc: 0.9650
14848/60000 [======>.......................] - ETA: 2s - loss: 0.1199 - acc: 0.9646
15616/60000 [======>.......................] - ETA: 2s - loss: 0.1193 - acc: 0.9648
16384/60000 [=======>......................] - ETA: 2s - loss: 0.1190 - acc: 0.9648
17152/60000 [=======>......................] - ETA: 2s - loss: 0.1175 - acc: 0.9653
17920/60000 [=======>......................] - ETA: 2s - loss: 0.1179 - acc: 0.9652
18816/60000 [========>.....................] - ETA: 2s - loss: 0.1174 - acc: 0.9652
19712/60000 [========>.....................] - ETA: 2s - loss: 0.1164 - acc: 0.9655
20608/60000 [=========>....................] - ETA: 2s - loss: 0.1168 - acc: 0.9653
21376/60000 [=========>....................] - ETA: 2s - loss: 0.1161 - acc: 0.9655
22144/60000 [==========>...................] - ETA: 2s - loss: 0.1155 - acc: 0.9655
22912/60000 [==========>...................] - ETA: 2s - loss: 0.1144 - acc: 0.9659
23808/60000 [==========>...................] - ETA: 2s - loss: 0.1136 - acc: 0.9662
24704/60000 [===========>..................] - ETA: 2s - loss: 0.1136 - acc: 0.9661
25600/60000 [===========>..................] - ETA: 2s - loss: 0.1121 - acc: 0.9665
26496/60000 [============>.................] - ETA: 2s - loss: 0.1121 - acc: 0.9663
27392/60000 [============>.................] - ETA: 2s - loss: 0.1116 - acc: 0.9667
28288/60000 [=============>................] - ETA: 2s - loss: 0.1111 - acc: 0.9668
29184/60000 [=============>................] - ETA: 2s - loss: 0.1107 - acc: 0.9669
30080/60000 [==============>...............] - ETA: 1s - loss: 0.1108 - acc: 0.9669
30848/60000 [==============>...............] - ETA: 1s - loss: 0.1109 - acc: 0.9669
31616/60000 [==============>...............] - ETA: 1s - loss: 0.1108 - acc: 0.9670
32384/60000 [===============>..............] - ETA: 1s - loss: 0.1107 - acc: 0.9671
33152/60000 [===============>..............] - ETA: 1s - loss: 0.1099 - acc: 0.9672
33920/60000 [===============>..............] - ETA: 1s - loss: 0.1104 - acc: 0.9669
34688/60000 [================>.............] - ETA: 1s - loss: 0.1101 - acc: 0.9669
35456/60000 [================>.............] - ETA: 1s - loss: 0.1094 - acc: 0.9672
36224/60000 [=================>............] - ETA: 1s - loss: 0.1091 - acc: 0.9673
36992/60000 [=================>............] - ETA: 1s - loss: 0.1091 - acc: 0.9674
37760/60000 [=================>............] - ETA: 1s - loss: 0.1087 - acc: 0.9675
38400/60000 [==================>...........] - ETA: 1s - loss: 0.1083 - acc: 0.9676
39040/60000 [==================>...........] - ETA: 1s - loss: 0.1084 - acc: 0.9675
39808/60000 [==================>...........] - ETA: 1s - loss: 0.1084 - acc: 0.9675
40704/60000 [===================>..........] - ETA: 1s - loss: 0.1079 - acc: 0.9676
41600/60000 [===================>..........] - ETA: 1s - loss: 0.1068 - acc: 0.9680
42496/60000 [====================>.........] - ETA: 1s - loss: 0.1066 - acc: 0.9680
43392/60000 [====================>.........] - ETA: 1s - loss: 0.1069 - acc: 0.9680
44288/60000 [=====================>........] - ETA: 1s - loss: 0.1067 - acc: 0.9680
45056/60000 [=====================>........] - ETA: 0s - loss: 0.1060 - acc: 0.9682
45824/60000 [=====================>........] - ETA: 0s - loss: 0.1058 - acc: 0.9682
46592/60000 [======================>.......] - ETA: 0s - loss: 0.1055 - acc: 0.9683
47360/60000 [======================>.......] - ETA: 0s - loss: 0.1051 - acc: 0.9684
48128/60000 [=======================>......] - ETA: 0s - loss: 0.1048 - acc: 0.9685
48896/60000 [=======================>......] - ETA: 0s - loss: 0.1045 - acc: 0.9686
49664/60000 [=======================>......] - ETA: 0s - loss: 0.1041 - acc: 0.9687
50432/60000 [========================>.....] - ETA: 0s - loss: 0.1043 - acc: 0.9687
51200/60000 [========================>.....] - ETA: 0s - loss: 0.1042 - acc: 0.9688
51968/60000 [========================>.....] - ETA: 0s - loss: 0.1038 - acc: 0.9688
52736/60000 [=========================>....] - ETA: 0s - loss: 0.1038 - acc: 0.9689
53504/60000 [=========================>....] - ETA: 0s - loss: 0.1039 - acc: 0.9689
54272/60000 [==========================>...] - ETA: 0s - loss: 0.1036 - acc: 0.9691
55040/60000 [==========================>...] - ETA: 0s - loss: 0.1031 - acc: 0.9692
55808/60000 [==========================>...] - ETA: 0s - loss: 0.1034 - acc: 0.9690
56576/60000 [===========================>..] - ETA: 0s - loss: 0.1030 - acc: 0.9692
57472/60000 [===========================>..] - ETA: 0s - loss: 0.1026 - acc: 0.9693
58368/60000 [============================>.] - ETA: 0s - loss: 0.1025 - acc: 0.9694
59264/60000 [============================>.] - ETA: 0s - loss: 0.1021 - acc: 0.9696
60000/60000 [==============================] - 4s 68us/step - loss: 0.1021 - acc: 0.9696
Epoch 3/5
128/60000 [..............................] - ETA: 4s - loss: 0.0370 - acc: 0.9766
1024/60000 [..............................] - ETA: 3s - loss: 0.0760 - acc: 0.9756
1920/60000 [..............................] - ETA: 3s - loss: 0.0629 - acc: 0.9807
2816/60000 [>.............................] - ETA: 3s - loss: 0.0644 - acc: 0.9819
3712/60000 [>.............................] - ETA: 3s - loss: 0.0643 - acc: 0.9822
4608/60000 [=>............................] - ETA: 3s - loss: 0.0651 - acc: 0.9811
5504/60000 [=>............................] - ETA: 3s - loss: 0.0657 - acc: 0.9816
6400/60000 [==>...........................] - ETA: 3s - loss: 0.0694 - acc: 0.9798
7296/60000 [==>...........................] - ETA: 3s - loss: 0.0671 - acc: 0.9807
8064/60000 [===>..........................] - ETA: 3s - loss: 0.0670 - acc: 0.9807
8832/60000 [===>..........................] - ETA: 3s - loss: 0.0677 - acc: 0.9797
9728/60000 [===>..........................] - ETA: 3s - loss: 0.0657 - acc: 0.9801
10624/60000 [====>.........................] - ETA: 3s - loss: 0.0655 - acc: 0.9800
11392/60000 [====>.........................] - ETA: 3s - loss: 0.0662 - acc: 0.9802
12288/60000 [=====>........................] - ETA: 3s - loss: 0.0664 - acc: 0.9800
13184/60000 [=====>........................] - ETA: 2s - loss: 0.0665 - acc: 0.9795
14080/60000 [======>.......................] - ETA: 2s - loss: 0.0671 - acc: 0.9797
14976/60000 [======>.......................] - ETA: 2s - loss: 0.0678 - acc: 0.9791
15872/60000 [======>.......................] - ETA: 2s - loss: 0.0688 - acc: 0.9792
16640/60000 [=======>......................] - ETA: 2s - loss: 0.0683 - acc: 0.9793
17408/60000 [=======>......................] - ETA: 2s - loss: 0.0691 - acc: 0.9791
18176/60000 [========>.....................] - ETA: 2s - loss: 0.0703 - acc: 0.9789
18944/60000 [========>.....................] - ETA: 2s - loss: 0.0700 - acc: 0.9790
19840/60000 [========>.....................] - ETA: 2s - loss: 0.0691 - acc: 0.9793
20736/60000 [=========>....................] - ETA: 2s - loss: 0.0691 - acc: 0.9793
21632/60000 [=========>....................] - ETA: 2s - loss: 0.0682 - acc: 0.9796
22528/60000 [==========>...................] - ETA: 2s - loss: 0.0682 - acc: 0.9796
23296/60000 [==========>...................] - ETA: 2s - loss: 0.0686 - acc: 0.9793
24064/60000 [===========>..................] - ETA: 2s - loss: 0.0682 - acc: 0.9794
24960/60000 [===========>..................] - ETA: 2s - loss: 0.0683 - acc: 0.9793
25856/60000 [===========>..................] - ETA: 2s - loss: 0.0685 - acc: 0.9792
26752/60000 [============>.................] - ETA: 2s - loss: 0.0684 - acc: 0.9791
27648/60000 [============>.................] - ETA: 2s - loss: 0.0679 - acc: 0.9793
28416/60000 [=============>................] - ETA: 2s - loss: 0.0680 - acc: 0.9793
29312/60000 [=============>................] - ETA: 1s - loss: 0.0685 - acc: 0.9795
30080/60000 [==============>...............] - ETA: 1s - loss: 0.0685 - acc: 0.9794
30848/60000 [==============>...............] - ETA: 1s - loss: 0.0680 - acc: 0.9795
31616/60000 [==============>...............] - ETA: 1s - loss: 0.0677 - acc: 0.9797
32512/60000 [===============>..............] - ETA: 1s - loss: 0.0676 - acc: 0.9796
33408/60000 [===============>..............] - ETA: 1s - loss: 0.0685 - acc: 0.9794
34304/60000 [================>.............] - ETA: 1s - loss: 0.0683 - acc: 0.9793
35200/60000 [================>.............] - ETA: 1s - loss: 0.0680 - acc: 0.9794
36096/60000 [=================>............] - ETA: 1s - loss: 0.0678 - acc: 0.9794
36992/60000 [=================>............] - ETA: 1s - loss: 0.0678 - acc: 0.9794
37888/60000 [=================>............] - ETA: 1s - loss: 0.0679 - acc: 0.9794
38784/60000 [==================>...........] - ETA: 1s - loss: 0.0675 - acc: 0.9795
39552/60000 [==================>...........] - ETA: 1s - loss: 0.0679 - acc: 0.9795
40320/60000 [===================>..........] - ETA: 1s - loss: 0.0677 - acc: 0.9795
41088/60000 [===================>..........] - ETA: 1s - loss: 0.0676 - acc: 0.9796
41984/60000 [===================>..........] - ETA: 1s - loss: 0.0674 - acc: 0.9796
42880/60000 [====================>.........] - ETA: 1s - loss: 0.0676 - acc: 0.9795
43776/60000 [====================>.........] - ETA: 1s - loss: 0.0675 - acc: 0.9796
44672/60000 [=====================>........] - ETA: 0s - loss: 0.0672 - acc: 0.9797
45440/60000 [=====================>........] - ETA: 0s - loss: 0.0672 - acc: 0.9798
46208/60000 [======================>.......] - ETA: 0s - loss: 0.0680 - acc: 0.9797
47104/60000 [======================>.......] - ETA: 0s - loss: 0.0679 - acc: 0.9798
47872/60000 [======================>.......] - ETA: 0s - loss: 0.0679 - acc: 0.9798
48640/60000 [=======================>......] - ETA: 0s - loss: 0.0681 - acc: 0.9797
49408/60000 [=======================>......] - ETA: 0s - loss: 0.0680 - acc: 0.9797
50176/60000 [========================>.....] - ETA: 0s - loss: 0.0680 - acc: 0.9798
50944/60000 [========================>.....] - ETA: 0s - loss: 0.0678 - acc: 0.9799
51712/60000 [========================>.....] - ETA: 0s - loss: 0.0673 - acc: 0.9800
52480/60000 [=========================>....] - ETA: 0s - loss: 0.0674 - acc: 0.9801
53248/60000 [=========================>....] - ETA: 0s - loss: 0.0676 - acc: 0.9800
54016/60000 [==========================>...] - ETA: 0s - loss: 0.0674 - acc: 0.9800
54912/60000 [==========================>...] - ETA: 0s - loss: 0.0673 - acc: 0.9801
55680/60000 [==========================>...] - ETA: 0s - loss: 0.0672 - acc: 0.9802
56576/60000 [===========================>..] - ETA: 0s - loss: 0.0676 - acc: 0.9801
57472/60000 [===========================>..] - ETA: 0s - loss: 0.0676 - acc: 0.9801
58368/60000 [============================>.] - ETA: 0s - loss: 0.0678 - acc: 0.9800
59264/60000 [============================>.] - ETA: 0s - loss: 0.0677 - acc: 0.9800
60000/60000 [==============================] - 4s 66us/step - loss: 0.0673 - acc: 0.9801
Epoch 4/5
128/60000 [..............................] - ETA: 4s - loss: 0.0537 - acc: 0.9766
1024/60000 [..............................] - ETA: 3s - loss: 0.0386 - acc: 0.9912
1792/60000 [..............................] - ETA: 3s - loss: 0.0440 - acc: 0.9900
2560/60000 [>.............................] - ETA: 3s - loss: 0.0523 - acc: 0.9863
3456/60000 [>.............................] - ETA: 3s - loss: 0.0512 - acc: 0.9864
4352/60000 [=>............................] - ETA: 3s - loss: 0.0566 - acc: 0.9830
5120/60000 [=>............................] - ETA: 3s - loss: 0.0545 - acc: 0.9834
5888/60000 [=>............................] - ETA: 3s - loss: 0.0534 - acc: 0.9835
6784/60000 [==>...........................] - ETA: 3s - loss: 0.0533 - acc: 0.9833
7680/60000 [==>...........................] - ETA: 3s - loss: 0.0554 - acc: 0.9824
8576/60000 [===>..........................] - ETA: 3s - loss: 0.0534 - acc: 0.9832
9472/60000 [===>..........................] - ETA: 3s - loss: 0.0529 - acc: 0.9830
10368/60000 [====>.........................] - ETA: 3s - loss: 0.0522 - acc: 0.9836
11264/60000 [====>.........................] - ETA: 3s - loss: 0.0521 - acc: 0.9838
12160/60000 [=====>........................] - ETA: 3s - loss: 0.0535 - acc: 0.9836
13056/60000 [=====>........................] - ETA: 3s - loss: 0.0518 - acc: 0.9843
13952/60000 [=====>........................] - ETA: 2s - loss: 0.0523 - acc: 0.9843
14848/60000 [======>.......................] - ETA: 2s - loss: 0.0518 - acc: 0.9844
15488/60000 [======>.......................] - ETA: 2s - loss: 0.0518 - acc: 0.9845
16256/60000 [=======>......................] - ETA: 2s - loss: 0.0519 - acc: 0.9843
17152/60000 [=======>......................] - ETA: 2s - loss: 0.0508 - acc: 0.9845
17920/60000 [=======>......................] - ETA: 2s - loss: 0.0512 - acc: 0.9843
18816/60000 [========>.....................] - ETA: 2s - loss: 0.0509 - acc: 0.9845
19584/60000 [========>.....................] - ETA: 2s - loss: 0.0518 - acc: 0.9843
20480/60000 [=========>....................] - ETA: 2s - loss: 0.0515 - acc: 0.9843
21376/60000 [=========>....................] - ETA: 2s - loss: 0.0518 - acc: 0.9840
22272/60000 [==========>...................] - ETA: 2s - loss: 0.0511 - acc: 0.9843
23168/60000 [==========>...................] - ETA: 2s - loss: 0.0508 - acc: 0.9844
24064/60000 [===========>..................] - ETA: 2s - loss: 0.0505 - acc: 0.9845
24960/60000 [===========>..................] - ETA: 2s - loss: 0.0502 - acc: 0.9845
25856/60000 [===========>..................] - ETA: 2s - loss: 0.0503 - acc: 0.9845
26752/60000 [============>.................] - ETA: 2s - loss: 0.0502 - acc: 0.9844
27648/60000 [============>.................] - ETA: 2s - loss: 0.0509 - acc: 0.9843
28544/60000 [=============>................] - ETA: 2s - loss: 0.0515 - acc: 0.9841
29440/60000 [=============>................] - ETA: 1s - loss: 0.0514 - acc: 0.9840
30336/60000 [==============>...............] - ETA: 1s - loss: 0.0514 - acc: 0.9839
31232/60000 [==============>...............] - ETA: 1s - loss: 0.0510 - acc: 0.9841
32000/60000 [===============>..............] - ETA: 1s - loss: 0.0507 - acc: 0.9842
32896/60000 [===============>..............] - ETA: 1s - loss: 0.0500 - acc: 0.9844
33792/60000 [===============>..............] - ETA: 1s - loss: 0.0506 - acc: 0.9842
34688/60000 [================>.............] - ETA: 1s - loss: 0.0501 - acc: 0.9843
35584/60000 [================>.............] - ETA: 1s - loss: 0.0499 - acc: 0.9843
36352/60000 [=================>............] - ETA: 1s - loss: 0.0495 - acc: 0.9845
37248/60000 [=================>............] - ETA: 1s - loss: 0.0494 - acc: 0.9845
38144/60000 [==================>...........] - ETA: 1s - loss: 0.0498 - acc: 0.9845
39040/60000 [==================>...........] - ETA: 1s - loss: 0.0495 - acc: 0.9846
39936/60000 [==================>...........] - ETA: 1s - loss: 0.0493 - acc: 0.9846
40832/60000 [===================>..........] - ETA: 1s - loss: 0.0495 - acc: 0.9845
41728/60000 [===================>..........] - ETA: 1s - loss: 0.0496 - acc: 0.9845
42624/60000 [====================>.........] - ETA: 1s - loss: 0.0499 - acc: 0.9843
43520/60000 [====================>.........] - ETA: 1s - loss: 0.0500 - acc: 0.9844
44416/60000 [=====================>........] - ETA: 0s - loss: 0.0500 - acc: 0.9845
45312/60000 [=====================>........] - ETA: 0s - loss: 0.0497 - acc: 0.9846
46208/60000 [======================>.......] - ETA: 0s - loss: 0.0502 - acc: 0.9844
47104/60000 [======================>.......] - ETA: 0s - loss: 0.0498 - acc: 0.9846
48000/60000 [=======================>......] - ETA: 0s - loss: 0.0498 - acc: 0.9846
48768/60000 [=======================>......] - ETA: 0s - loss: 0.0497 - acc: 0.9846
49664/60000 [=======================>......] - ETA: 0s - loss: 0.0495 - acc: 0.9848
50560/60000 [========================>.....] - ETA: 0s - loss: 0.0498 - acc: 0.9848
51456/60000 [========================>.....] - ETA: 0s - loss: 0.0498 - acc: 0.9847
52352/60000 [=========================>....] - ETA: 0s - loss: 0.0497 - acc: 0.9847
53248/60000 [=========================>....] - ETA: 0s - loss: 0.0498 - acc: 0.9847
54144/60000 [==========================>...] - ETA: 0s - loss: 0.0496 - acc: 0.9847
55040/60000 [==========================>...] - ETA: 0s - loss: 0.0498 - acc: 0.9847
55936/60000 [==========================>...] - ETA: 0s - loss: 0.0495 - acc: 0.9848
56832/60000 [===========================>..] - ETA: 0s - loss: 0.0493 - acc: 0.9849
57728/60000 [===========================>..] - ETA: 0s - loss: 0.0494 - acc: 0.9847
58624/60000 [============================>.] - ETA: 0s - loss: 0.0494 - acc: 0.9847
59520/60000 [============================>.] - ETA: 0s - loss: 0.0491 - acc: 0.9848
60000/60000 [==============================] - 4s 63us/step - loss: 0.0491 - acc: 0.9849
Epoch 5/5
128/60000 [..............................] - ETA: 4s - loss: 0.0221 - acc: 1.0000
1024/60000 [..............................] - ETA: 3s - loss: 0.0466 - acc: 0.9893
1920/60000 [..............................] - ETA: 3s - loss: 0.0402 - acc: 0.9891
2816/60000 [>.............................] - ETA: 3s - loss: 0.0361 - acc: 0.9890
3712/60000 [>.............................] - ETA: 3s - loss: 0.0356 - acc: 0.9892
4608/60000 [=>............................] - ETA: 3s - loss: 0.0357 - acc: 0.9896
5504/60000 [=>............................] - ETA: 3s - loss: 0.0342 - acc: 0.9898
6400/60000 [==>...........................] - ETA: 3s - loss: 0.0355 - acc: 0.9895
7296/60000 [==>...........................] - ETA: 3s - loss: 0.0338 - acc: 0.9904
8192/60000 [===>..........................] - ETA: 3s - loss: 0.0338 - acc: 0.9901
9088/60000 [===>..........................] - ETA: 3s - loss: 0.0332 - acc: 0.9904
9984/60000 [===>..........................] - ETA: 3s - loss: 0.0341 - acc: 0.9899
10880/60000 [====>.........................] - ETA: 3s - loss: 0.0331 - acc: 0.9903
11776/60000 [====>.........................] - ETA: 3s - loss: 0.0342 - acc: 0.9898
12544/60000 [=====>........................] - ETA: 2s - loss: 0.0335 - acc: 0.9902
13312/60000 [=====>........................] - ETA: 2s - loss: 0.0332 - acc: 0.9904
14080/60000 [======>.......................] - ETA: 2s - loss: 0.0332 - acc: 0.9901
14848/60000 [======>.......................] - ETA: 2s - loss: 0.0328 - acc: 0.9902
15744/60000 [======>.......................] - ETA: 2s - loss: 0.0325 - acc: 0.9905
16640/60000 [=======>......................] - ETA: 2s - loss: 0.0323 - acc: 0.9906
17536/60000 [=======>......................] - ETA: 2s - loss: 0.0317 - acc: 0.9909
18432/60000 [========>.....................] - ETA: 2s - loss: 0.0314 - acc: 0.9908
19328/60000 [========>.....................] - ETA: 2s - loss: 0.0319 - acc: 0.9906
20224/60000 [=========>....................] - ETA: 2s - loss: 0.0320 - acc: 0.9904
21120/60000 [=========>....................] - ETA: 2s - loss: 0.0322 - acc: 0.9903
22016/60000 [==========>...................] - ETA: 2s - loss: 0.0326 - acc: 0.9902
22912/60000 [==========>...................] - ETA: 2s - loss: 0.0323 - acc: 0.9903
23808/60000 [==========>...................] - ETA: 2s - loss: 0.0331 - acc: 0.9900
24704/60000 [===========>..................] - ETA: 2s - loss: 0.0336 - acc: 0.9898
25600/60000 [===========>..................] - ETA: 2s - loss: 0.0338 - acc: 0.9897
26496/60000 [============>.................] - ETA: 2s - loss: 0.0340 - acc: 0.9897
27392/60000 [============>.................] - ETA: 2s - loss: 0.0337 - acc: 0.9898
28288/60000 [=============>................] - ETA: 1s - loss: 0.0337 - acc: 0.9897
29056/60000 [=============>................] - ETA: 1s - loss: 0.0338 - acc: 0.9897
29824/60000 [=============>................] - ETA: 1s - loss: 0.0338 - acc: 0.9897
30720/60000 [==============>...............] - ETA: 1s - loss: 0.0347 - acc: 0.9894
31616/60000 [==============>...............] - ETA: 1s - loss: 0.0344 - acc: 0.9895
32512/60000 [===============>..............] - ETA: 1s - loss: 0.0342 - acc: 0.9894
33408/60000 [===============>..............] - ETA: 1s - loss: 0.0346 - acc: 0.9892
34304/60000 [================>.............] - ETA: 1s - loss: 0.0345 - acc: 0.9892
35200/60000 [================>.............] - ETA: 1s - loss: 0.0348 - acc: 0.9892
36096/60000 [=================>............] - ETA: 1s - loss: 0.0347 - acc: 0.9893
36992/60000 [=================>............] - ETA: 1s - loss: 0.0344 - acc: 0.9892
37888/60000 [=================>............] - ETA: 1s - loss: 0.0344 - acc: 0.9892
38784/60000 [==================>...........] - ETA: 1s - loss: 0.0344 - acc: 0.9893
39680/60000 [==================>...........] - ETA: 1s - loss: 0.0344 - acc: 0.9893
40576/60000 [===================>..........] - ETA: 1s - loss: 0.0349 - acc: 0.9892
41472/60000 [===================>..........] - ETA: 1s - loss: 0.0351 - acc: 0.9891
42368/60000 [====================>.........] - ETA: 1s - loss: 0.0348 - acc: 0.9892
43264/60000 [====================>.........] - ETA: 1s - loss: 0.0347 - acc: 0.9893
44160/60000 [=====================>........] - ETA: 0s - loss: 0.0348 - acc: 0.9893
45056/60000 [=====================>........] - ETA: 0s - loss: 0.0348 - acc: 0.9893
45952/60000 [=====================>........] - ETA: 0s - loss: 0.0349 - acc: 0.9892
46720/60000 [======================>.......] - ETA: 0s - loss: 0.0347 - acc: 0.9893
47616/60000 [======================>.......] - ETA: 0s - loss: 0.0347 - acc: 0.9893
48512/60000 [=======================>......] - ETA: 0s - loss: 0.0350 - acc: 0.9893
49408/60000 [=======================>......] - ETA: 0s - loss: 0.0348 - acc: 0.9893
50304/60000 [========================>.....] - ETA: 0s - loss: 0.0350 - acc: 0.9892
51200/60000 [========================>.....] - ETA: 0s - loss: 0.0353 - acc: 0.9891
52096/60000 [=========================>....] - ETA: 0s - loss: 0.0350 - acc: 0.9893
52992/60000 [=========================>....] - ETA: 0s - loss: 0.0352 - acc: 0.9892
53888/60000 [=========================>....] - ETA: 0s - loss: 0.0355 - acc: 0.9892
54784/60000 [==========================>...] - ETA: 0s - loss: 0.0354 - acc: 0.9892
55680/60000 [==========================>...] - ETA: 0s - loss: 0.0353 - acc: 0.9893
56576/60000 [===========================>..] - ETA: 0s - loss: 0.0357 - acc: 0.9892
57472/60000 [===========================>..] - ETA: 0s - loss: 0.0361 - acc: 0.9892
58240/60000 [============================>.] - ETA: 0s - loss: 0.0363 - acc: 0.9891
59136/60000 [============================>.] - ETA: 0s - loss: 0.0364 - acc: 0.9891
60000/60000 [==============================] - 4s 62us/step - loss: 0.0363 - acc: 0.9891
32/10000 [..............................] - ETA: 7s
1344/10000 [===>..........................] - ETA: 0s
2528/10000 [======>.......................] - ETA: 0s
3840/10000 [==========>...................] - ETA: 0s
5152/10000 [==============>...............] - ETA: 0s
6400/10000 [==================>...........] - ETA: 0s
7584/10000 [=====================>........] - ETA: 0s
8864/10000 [=========================>....] - ETA: 0s
10000/10000 [==============================] - 0s 42us/step
test_acc: 0.9808