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 00000000..a9111e05 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 00000000..a2d05f48 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 00000000..bcccd8f2 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 00000000..8de91ff5 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 00000000..0a10a33f 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 00000000..293c0449 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 00000000..00ee5764 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 00000000..f3a7079d 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 00000000..f6d4ff7b 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 00000000..a4a22dbf 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 00000000..8f0acf88 Binary files /dev/null and b/docs/TensorFlow2.x/img/overfit_and_underfit__4.png differ diff --git a/docs/TensorFlow2.x/实战项目_2_汽车燃油效率.md b/docs/TensorFlow2.x/实战项目_2_汽车燃油效率.md index 9f1a6459..84184d38 100644 --- a/docs/TensorFlow2.x/实战项目_2_汽车燃油效率.md +++ b/docs/TensorFlow2.x/实战项目_2_汽车燃油效率.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/实战项目_3_优化_过拟合和欠拟合.md b/docs/TensorFlow2.x/实战项目_3_优化_过拟合和欠拟合.md index a5a4abcb..4039ae2a 100644 --- a/docs/TensorFlow2.x/实战项目_3_优化_过拟合和欠拟合.md +++ b/docs/TensorFlow2.x/实战项目_3_优化_过拟合和欠拟合.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 是对基线模型的明显改进。