プリンキピア

第3章回帰のための線形ニューラルネットワーク

3.6.2. Underfitting or Overfitting?3.6.2 未学習か過学習か

When we compare the training and validation errors, we want to be mindful of two common situations. First, we want to watch out for cases when our training error and validation error are both substantial but there is a little gap between them. If the model is unable to reduce the training error, that could mean that our model is too simple (i.e., insufficiently expressive) to capture the pattern that we are trying to model. Moreover, since the generalization gap (Remp−R) between our training and generalization errors is small, we have reason to believe that we could get away with a more complex model. This phenomenon is known as underfitting.
英語のヒント
訓練誤差と検証誤差を比べるときは、よくある二つの状況に注意したい。第一に、訓練誤差と検証誤差がどちらも大きいが、そのあいだのギャップが小さい場合に気をつけたい。モデルが訓練誤差を減らせないなら、それはモデルが単純すぎて(つまり表現力が足りなくて)、モデル化しようとしているパターンをとらえられないことを意味するかもしれない。さらに、訓練誤差と汎化誤差のあいだの汎化ギャップ(Remp−R)が小さいので、もっと複雑なモデルでもやっていけると考える理由がある。この現象は未学習として知られる。
On the other hand, as we discussed above, we want to watch out for the cases when our training error is significantly lower than our validation error, indicating severe overfitting. Note that overfitting is not always a bad thing. In deep learning especially, the best predictive models often perform far better on training data than on holdout data. Ultimately, we usually care about driving the generalization error lower, and only care about the gap insofar as it becomes an obstacle to that end. Note that if the training error is zero, then the generalization gap is precisely equal to the generalization error and we can make progress only by reducing the gap.
英語のヒント
一方、上で論じたように、訓練誤差が検証誤差より著しく低く、深刻な過学習を示している場合にも気をつけたい。過学習がいつも悪いことだとは限らないことに注意してほしい。特に深層学習では、最良の予測モデルは、取り分けておいたデータより訓練データでずっとよい成績を出すことが多い。結局のところ、私たちが普通気にかけるのは汎化誤差を下げることであり、ギャップを気にするのは、それがその目的の妨げになるかぎりにおいてである。訓練誤差がゼロなら、汎化ギャップは汎化誤差にちょうど等しく、ギャップを減らすことでしか前に進めないことに注意してほしい。

3.6.2.1. Polynomial Curve Fitting3.6.2.1 多項式曲線の当てはめ

To illustrate some classical intuition about overfitting and model complexity, consider the following: given training data consisting of a single feature x and a corresponding real-valued label y, we try to find the polynomial of degree d
英語のヒント
過学習とモデルの複雑さについての古典的な直観を示すために、次の問題を考えよう。一つの特徴量xと、対応する実数値のラベルyからなる訓練データが与えられたとき、次のd次の多項式を見つけようとする。
yˆ=∑i=0dxiwi(3.6.3)
for estimating the label y. This is just a linear regression problem where our features are given by the powers of x, the model’s weights are given by wi, and the bias is given by w0 since x0=1 for all x. Since this is just a linear regression problem, we can use the squared error as our loss function.
英語のヒント
これはラベルyを推定するためのものである。これは、特徴量がxのべき乗で、モデルの重みがwiで、すべてのxについてx0=1なのでバイアスがw0で与えられる、ただの線形回帰問題である。ただの線形回帰問題なので、損失関数として二乗誤差を使える。
A higher-order polynomial function is more complex than a lower-order polynomial function, since the higher-order polynomial has more parameters and the model function’s selection range is wider. Fixing the training dataset, higher-order polynomial functions should always achieve lower (at worst, equal) training error relative to lower-degree polynomials. In fact, whenever each data example has a distinct value of x, a polynomial function with degree equal to the number of data examples can fit the training set perfectly. We compare the relationship between polynomial degree (model complexity) and both underfitting and overfitting in Fig. 3.6.1.
英語のヒント
高次の多項式関数は、低次の多項式関数より複雑である。高次の多項式はパラメータが多く、モデルの関数の選択範囲が広いからである。訓練データセットを固定すれば、高次の多項式関数は、低次の多項式と比べて、いつもより低い(悪くても同じ)訓練誤差を達成するはずである。実際、各データ事例が異なるxの値をもつなら、次数がデータ事例の数に等しい多項式関数は、訓練集合に完璧に当てはまる。図3.6.1では、多項式の次数(モデルの複雑さ)と、未学習・過学習の両方との関係を比べている。
Fig. 3.6.1図3.6.1
Influence of model complexity on underfitting and overfitting.
英語のヒント
未学習と過学習に対するモデルの複雑さの影響。

3.6.2.2. Dataset Size3.6.2.2 データセットの大きさ

As the above bound already indicates, another big consideration to bear in mind is dataset size. Fixing our model, the fewer samples we have in the training dataset, the more likely (and more severely) we are to encounter overfitting. As we increase the amount of training data, the generalization error typically decreases. Moreover, in general, more data never hurts. For a fixed task and data distribution, model complexity should not increase more rapidly than the amount of data. Given more data, we might attempt to fit a more complex model. Absent sufficient data, simpler models may be more difficult to beat. For many tasks, deep learning only outperforms linear models when many thousands of training examples are available. In part, the current success of deep learning owes considerably to the abundance of massive datasets arising from Internet companies, cheap storage, connected devices, and the broad digitization of the economy.
英語のヒント
上の限界がすでに示しているように、心にとめておくべきもう一つの大きな考慮事項は、データセットの大きさである。モデルを固定すると、訓練データセットのサンプルが少ないほど、過学習に出会う可能性が高く(そして深刻に)なる。訓練データの量を増やすと、汎化誤差は普通減る。さらに一般に、データが多くて困ることはない。ある課題とデータ分布について、モデルの複雑さはデータの量より速く増やすべきではない。データが多ければ、もっと複雑なモデルを当てはめようとしてもよい。十分なデータがなければ、単純なモデルのほうが打ち負かしにくいかもしれない。多くの課題で、深層学習が線形モデルを上回るのは、何千もの訓練事例が手に入るときだけである。今の深層学習の成功は、インターネット企業、安価なストレージ、接続された機器、経済の広範なデジタル化から生じる、膨大なデータセットの豊富さにかなり負っている。