2020-10-19 21:26:11

This commit is contained in:
wizardforcel
2020-10-19 21:26:11 +08:00
parent 6b80fe415e
commit 1cb8005341
13 changed files with 11 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -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)
它不是完全的高斯分布,但我们可以推断出,这是因为样本的数量很小所导致的。

View File

@@ -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 是对基线模型的明显改进。