diff --git a/docs/TensorFlow2.x/img/output_23_1.png b/docs/TensorFlow2.x/img/output_23_1.png new file mode 100644 index 0000000000000000000000000000000000000000..a9111e054197221bc4a6ec95c369c1a99117c530 Binary files /dev/null and b/docs/TensorFlow2.x/img/output_23_1.png differ diff --git a/docs/TensorFlow2.x/img/output_45_0.png b/docs/TensorFlow2.x/img/output_45_0.png new file mode 100644 index 0000000000000000000000000000000000000000..a2d05f487e0a4835bc6a2e64bccc15390fa39a5f Binary files /dev/null and b/docs/TensorFlow2.x/img/output_45_0.png differ diff --git a/docs/TensorFlow2.x/img/output_45_1.png b/docs/TensorFlow2.x/img/output_45_1.png new file mode 100644 index 0000000000000000000000000000000000000000..bcccd8f2db867505654863d8a0472f9c387c1eab Binary files /dev/null and b/docs/TensorFlow2.x/img/output_45_1.png differ diff --git a/docs/TensorFlow2.x/img/output_47_1.png b/docs/TensorFlow2.x/img/output_47_1.png new file mode 100644 index 0000000000000000000000000000000000000000..8de91ff5c4b58b07138c7de9b3b54b005ada2ab2 Binary files /dev/null and b/docs/TensorFlow2.x/img/output_47_1.png differ diff --git a/docs/TensorFlow2.x/img/output_47_2.png b/docs/TensorFlow2.x/img/output_47_2.png new file mode 100644 index 0000000000000000000000000000000000000000..0a10a33f53eb6e076049fbb21aec87c245eb8708 Binary files /dev/null and b/docs/TensorFlow2.x/img/output_47_2.png differ diff --git a/docs/TensorFlow2.x/img/output_51_1.png b/docs/TensorFlow2.x/img/output_51_1.png new file mode 100644 index 0000000000000000000000000000000000000000..293c044953821e5d06946c6c18a8a73606c5b0c1 Binary files /dev/null and b/docs/TensorFlow2.x/img/output_51_1.png differ diff --git a/docs/TensorFlow2.x/img/output_53_0.png b/docs/TensorFlow2.x/img/output_53_0.png new file mode 100644 index 0000000000000000000000000000000000000000..00ee57642ffd3ff236e80c60aa70af0e7f90a692 Binary files /dev/null and b/docs/TensorFlow2.x/img/output_53_0.png differ diff --git a/docs/TensorFlow2.x/img/overfit_and_underfit__1.png b/docs/TensorFlow2.x/img/overfit_and_underfit__1.png new file mode 100644 index 0000000000000000000000000000000000000000..f3a7079d4edeb59fbf8e18c635b955fad8f253d1 Binary files /dev/null and b/docs/TensorFlow2.x/img/overfit_and_underfit__1.png differ diff --git a/docs/TensorFlow2.x/img/overfit_and_underfit__2.png b/docs/TensorFlow2.x/img/overfit_and_underfit__2.png new file mode 100644 index 0000000000000000000000000000000000000000..f6d4ff7b856426c8ad57e7736865614eb168a632 Binary files /dev/null and b/docs/TensorFlow2.x/img/overfit_and_underfit__2.png differ diff --git a/docs/TensorFlow2.x/img/overfit_and_underfit__3.png b/docs/TensorFlow2.x/img/overfit_and_underfit__3.png new file mode 100644 index 0000000000000000000000000000000000000000..a4a22dbfbc1f85dcb7bde41a904e7dbdb7b2b8fc Binary files /dev/null and b/docs/TensorFlow2.x/img/overfit_and_underfit__3.png differ diff --git a/docs/TensorFlow2.x/img/overfit_and_underfit__4.png b/docs/TensorFlow2.x/img/overfit_and_underfit__4.png new file mode 100644 index 0000000000000000000000000000000000000000..8f0acf880354cc3d57d74808e1699d5da61acddb Binary files /dev/null and b/docs/TensorFlow2.x/img/overfit_and_underfit__4.png differ diff --git "a/docs/TensorFlow2.x/\345\256\236\346\210\230\351\241\271\347\233\256_2_\346\261\275\350\275\246\347\207\203\346\262\271\346\225\210\347\216\207.md" "b/docs/TensorFlow2.x/\345\256\236\346\210\230\351\241\271\347\233\256_2_\346\261\275\350\275\246\347\207\203\346\262\271\346\225\210\347\216\207.md" index 9f1a64595c1d6e4177e044f6b2ca0db5412b56c0..84184d387ebcdd04702bcf359523cf754cb064ff 100644 --- "a/docs/TensorFlow2.x/\345\256\236\346\210\230\351\241\271\347\233\256_2_\346\261\275\350\275\246\347\207\203\346\262\271\346\225\210\347\216\207.md" +++ "b/docs/TensorFlow2.x/\345\256\236\346\210\230\351\241\271\347\233\256_2_\346\261\275\350\275\246\347\207\203\346\262\271\346\225\210\347\216\207.md" @@ -333,7 +333,7 @@ sns.pairplot(train_dataset[["MPG", "Cylinders", "Displacement", "Weight"]], diag -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/output_23_1.png) +![png](img/output_23_1.png) 也可以查看总体的数据统计: @@ -728,11 +728,11 @@ plot_history(history) ``` -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/output_45_0.png) +![png](img/output_45_0.png) -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/output_45_1.png) +![png](img/output_45_1.png) 该图表显示在约100个 epochs 之后误差非但没有改进,反而出现恶化。 让我们更新 `model.fit` 调用,当验证值没有提高上是自动停止训练。 @@ -758,11 +758,11 @@ plot_history(history) ........................................................ -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/output_47_1.png) +![png](img/output_47_1.png) -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/output_47_2.png) +![png](img/output_47_2.png) 如图所示,验证集中的平均的误差通常在 +/- 2 MPG左右。 这个结果好么? 我们将决定权留给你。 @@ -804,7 +804,7 @@ _ = plt.plot([-100, 100], [-100, 100]) -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/output_51_1.png) +![png](img/output_51_1.png) 这看起来我们的模型预测得相当好。我们来看下误差分布。 @@ -818,7 +818,7 @@ _ = plt.ylabel("Count") ``` -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/output_53_0.png) +![png](img/output_53_0.png) 它不是完全的高斯分布,但我们可以推断出,这是因为样本的数量很小所导致的。 diff --git "a/docs/TensorFlow2.x/\345\256\236\346\210\230\351\241\271\347\233\256_3_\344\274\230\345\214\226_\350\277\207\346\213\237\345\220\210\345\222\214\346\254\240\346\213\237\345\220\210.md" "b/docs/TensorFlow2.x/\345\256\236\346\210\230\351\241\271\347\233\256_3_\344\274\230\345\214\226_\350\277\207\346\213\237\345\220\210\345\222\214\346\254\240\346\213\237\345\220\210.md" index a5a4abcb7e227ea480091ea27c9b57c5df75614e..4039ae2a55a0d6cb577eeebc1dd639a855c4d6dc 100644 --- "a/docs/TensorFlow2.x/\345\256\236\346\210\230\351\241\271\347\233\256_3_\344\274\230\345\214\226_\350\277\207\346\213\237\345\220\210\345\222\214\346\254\240\346\213\237\345\220\210.md" +++ "b/docs/TensorFlow2.x/\345\256\236\346\210\230\351\241\271\347\233\256_3_\344\274\230\345\214\226_\350\277\207\346\213\237\345\220\210\345\222\214\346\254\240\346\213\237\345\220\210.md" @@ -61,7 +61,7 @@ test_data = multi_hot_sequences(test_data, dimension=NUM_WORDS) plt.plot(train_data[0]) ``` -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/overfit_and_underfit__1.png) +![png](img/overfit_and_underfit__1.png) ## 证明过拟合 @@ -327,7 +327,7 @@ plot_history([('baseline', baseline_history), ('bigger', bigger_history)]) ``` -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/overfit_and_underfit__2.png) +![png](img/overfit_and_underfit__2.png) 请注意,较大的网络仅在一个时期后就开始过拟合,而且过拟合严重。网络的容量越多,将能够更快地对训练数据进行建模(导致较低的训练损失),但网络越容易过拟合(导致训练和验证损失之间存在较大差异)。 @@ -421,7 +421,7 @@ plot_history([('baseline', baseline_history), ('l2', l2_model_history)]) ``` -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/overfit_and_underfit__3.png) +![png](img/overfit_and_underfit__3.png) 如您所见,即使两个模型具有相同数量的参数,L2正则化模型也比基线模型具有更高的抗过度拟合能力。 @@ -504,7 +504,7 @@ plot_history([('baseline', baseline_history), ('dropout', dpt_model_history)]) ``` -![png](http://data.apachecn.org/img/AiLearning/TensorFlow2.x/overfit_and_underfit__4.png) +![png](img/overfit_and_underfit__4.png) 添加 dropout 是对基线模型的明显改进。