Python深度学习(肖莱Chollet)笔记
相关资源
Python深度学习@Chenghsi Hsieh.Bilibili
环境配置
IDE:Pycharm
库:
Python = 3.6 (官方代码推荐版本)
keras = 2.0.8 (官方代码推荐版本)
numpy = 1.16.2
tensorflow = 1.15.0
第3章 神经网络
3.4 电影评论分类:二分类问题
IMDB数据集
点击查看<训练过程监测>代码
15000/15000 [==============================] - 3s - loss: 0.5157 - binary_accuracy: 0.7895 - val_loss: 0.4009 - val_binary_accuracy: 0.8653
Epoch 2/20
15000/15000 [==============================] - 1s - loss: 0.3146 - binary_accuracy: 0.9029 - val_loss: 0.3247 - val_binary_accuracy: 0.8787
Epoch 3/20
15000/15000 [==============================] - 1s - loss: 0.2319 - binary_accuracy: 0.9246 - val_loss: 0.2808 - val_binary_accuracy: 0.8923
Epoch 4/20
15000/15000 [==============================] - 1s - loss: 0.1816 - binary_accuracy: 0.9430 - val_loss: 0.2729 - val_binary_accuracy: 0.8905
Epoch 5/20
15000/15000 [==============================] - 1s - loss: 0.1495 - binary_accuracy: 0.9513 - val_loss: 0.2780 - val_binary_accuracy: 0.8891
Epoch 6/20
15000/15000 [==============================] - 1s - loss: 0.1209 - binary_accuracy: 0.9631 - val_loss: 0.3221 - val_binary_accuracy: 0.8807
Epoch 7/20
15000/15000 [==============================] - 1s - loss: 0.1031 - binary_accuracy: 0.9692 - val_loss: 0.3045 - val_binary_accuracy: 0.8848
Epoch 8/20
15000/15000 [==============================] - 1s - loss: 0.0847 - binary_accuracy: 0.9759 - val_loss: 0.3365 - val_binary_accuracy: 0.8773
Epoch 9/20
15000/15000 [==============================] - 1s - loss: 0.0728 - binary_accuracy: 0.9806 - val_loss: 0.3593 - val_binary_accuracy: 0.8802
Epoch 10/20
15000/15000 [==============================] - 1s - loss: 0.0582 - binary_accuracy: 0.9859 - val_loss: 0.3728 - val_binary_accuracy: 0.8804
Epoch 11/20
15000/15000 [==============================] - 1s - loss: 0.0491 - binary_accuracy: 0.9885 - val_loss: 0.3981 - val_binary_accuracy: 0.8782
Epoch 12/20
15000/15000 [==============================] - 1s - loss: 0.0388 - binary_accuracy: 0.9919 - val_loss: 0.4392 - val_binary_accuracy: 0.8777
Epoch 13/20
15000/15000 [==============================] - 1s - loss: 0.0302 - binary_accuracy: 0.9943 - val_loss: 0.4528 - val_binary_accuracy: 0.8743
Epoch 14/20
15000/15000 [==============================] - 1s - loss: 0.0245 - binary_accuracy: 0.9956 - val_loss: 0.4800 - val_binary_accuracy: 0.8731
Epoch 15/20
15000/15000 [==============================] - 1s - loss: 0.0196 - binary_accuracy: 0.9970 - val_loss: 0.5728 - val_binary_accuracy: 0.8664
Epoch 16/20
15000/15000 [==============================] - 1s - loss: 0.0127 - binary_accuracy: 0.9992 - val_loss: 0.5567 - val_binary_accuracy: 0.8728
Epoch 17/20
15000/15000 [==============================] - 1s - loss: 0.0121 - binary_accuracy: 0.9987 - val_loss: 0.5847 - val_binary_accuracy: 0.8724
Epoch 18/20
15000/15000 [==============================] - 1s - loss: 0.0099 - binary_accuracy: 0.9983 - val_loss: 0.6082 - val_binary_accuracy: 0.8694
Epoch 19/20
15000/15000 [==============================] - 1s - loss: 0.0071 - binary_accuracy: 0.9992 - val_loss: 0.6401 - val_binary_accuracy: 0.8675
Epoch 20/20
15000/15000 [==============================] - 1s - loss: 0.0039 - binary_accuracy: 0.9999 - val_loss: 0.6813 - val_binary_accuracy: 0.8672
Epoch 1/4
25000/25000 [==============================] - 1s - loss: 0.4714 - acc: 0.8102
Epoch 2/4
25000/25000 [==============================] - 1s - loss: 0.2651 - acc: 0.9083
Epoch 3/4
25000/25000 [==============================] - 1s - loss: 0.2022 - acc: 0.9276
Epoch 4/4
25000/25000 [==============================] - 1s - loss: 0.1688 - acc: 0.9400
24800/25000 [============================>.] - ETA: 0s
图 3-7 训练损失和验证损失
图 3-8 训练精度和验证精度