プリンキピア

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

3.6.1. Training Error and Generalization Error3.6.1 訓練誤差と汎化誤差

In the standard supervised learning setting, we assume that the training data and the test data are drawn independently from identical distributions. This is commonly called the IID assumption. While this assumption is strong, it is worth noting that, absent any such assumption, we would be dead in the water. Why should we believe that training data sampled from distribution P(X,Y) should tell us how to make predictions on test data generated by a different distribution Q(X,Y)? Making such leaps turns out to require strong assumptions about how P and Q are related. Later on we will discuss some assumptions that allow for shifts in distribution but first we need to understand the IID case, where P(⋅)=Q(⋅).
英語のヒント
標準的な教師あり学習の設定では、訓練データとテストデータは、同一の分布から独立に抽出されると仮定する。これは普通、IIDの仮定と呼ばれる。この仮定は強いが、そうした仮定がなければ、まったく身動きがとれなくなることは注目に値する。分布P(X,Y)から抽出した訓練データが、別の分布Q(X,Y)が生成したテストデータで予測する方法を教えてくれると、なぜ信じられようか。そうした飛躍をするには、PとQがどう関係しているかについて強い仮定が必要になることがわかる。後で、分布のずれを許すいくつかの仮定を論じるが、まずはP(⋅)=Q(⋅)であるIIDの場合を理解する必要がある。
To begin with, we need to differentiate between the training error Remp, which is a statistic calculated on the training dataset, and the generalization error R, which is an expectation taken with respect to the underlying distribution. You can think of the generalization error as what you would see if you applied your model to an infinite stream of additional data examples drawn from the same underlying data distribution. Formally the training error is expressed as a sum (with the same notation as Section 3.1):
英語のヒント
まず、訓練データセットで計算される統計量である訓練誤差Rempと、根底にある分布についてとられる期待値である汎化誤差Rとを区別する必要がある。汎化誤差は、同じ根底にあるデータ分布から抽出した追加のデータ事例の無限の流れにモデルを当てはめたら見えるもの、と考えればよい。形式的には、訓練誤差は(3.1節と同じ記法で)和として表される。
Remp[𝐗,𝐲,f]=1n∑i=1nl(𝐱(i),y(i),f(𝐱(i))),(3.6.1)
while the generalization error is expressed as an integral:
英語のヒント
一方、汎化誤差は積分として表される。
R[p,f]=E(𝐱,y)∼P[l(𝐱,y,f(𝐱))]=∫∫l(𝐱,y,f(𝐱))p(𝐱,y)d𝐱dy.(3.6.2)
Problematically, we can never calculate the generalization error R exactly. Nobody ever tells us the precise form of the density function p(𝐱,y). Moreover, we cannot sample an infinite stream of data points. Thus, in practice, we must estimate the generalization error by applying our model to an independent test set constituted of a random selection of examples 𝐗′ and labels 𝐲′ that were withheld from our training set. This consists of applying the same formula that was used for calculating the empirical training error but to a test set 𝐗′,𝐲′.
英語のヒント
困ったことに、汎化誤差Rを正確に計算することは決してできない。密度関数p(𝐱,y)の正確な形を誰も教えてくれない。しかも、データ点の無限の流れをサンプリングすることはできない。したがって実際には、訓練集合から取り分けておいた事例𝐗′とラベル𝐲′を無作為に選んで構成した、独立したテスト集合にモデルを当てはめることで、汎化誤差を推定しなければならない。これは、経験的な訓練誤差の計算に使ったのと同じ公式を、テスト集合𝐗′,𝐲′に当てはめることからなる。
Crucially, when we evaluate our classifier on the test set, we are working with a fixed classifier (it does not depend on the sample of the test set), and thus estimating its error is simply the problem of mean estimation. However the same cannot be said for the training set. Note that the model we wind up with depends explicitly on the selection of the training set and thus the training error will in general be a biased estimate of the true error on the underlying population. The central question of generalization is then when should we expect our training error to be close to the population error (and thus the generalization error).
英語のヒント
決定的に重要なのは、テスト集合で分類器を評価するとき、私たちは固定された分類器を扱っている(テスト集合のサンプルには依存しない)ので、その誤差の推定は単に平均の推定の問題だということである。しかし、訓練集合については同じことは言えない。最終的に得られるモデルは訓練集合の選び方に明示的に依存するので、訓練誤差は一般に、根底にある母集団での本当の誤差の偏った推定値になることに注意してほしい。そこで汎化の中心的な問いは、訓練誤差が母集団の誤差(したがって汎化誤差)に近いと期待してよいのはいつか、ということになる。

3.6.1.1. Model Complexity3.6.1.1 モデルの複雑さ

In classical theory, when we have simple models and abundant data, the training and generalization errors tend to be close. However, when we work with more complex models and/or fewer examples, we expect the training error to go down but the generalization gap to grow. This should not be surprising. Imagine a model class so expressive that for any dataset of n examples, we can find a set of parameters that can perfectly fit arbitrary labels, even if randomly assigned. In this case, even if we fit our training data perfectly, how can we conclude anything about the generalization error? For all we know, our generalization error might be no better than random guessing.
英語のヒント
古典的な理論では、単純なモデルと豊富なデータがあるとき、訓練誤差と汎化誤差は近くなる傾向がある。しかし、より複雑なモデルや、より少ない事例(あるいはその両方)を扱うと、訓練誤差は下がるが汎化のギャップは広がると予想される。これは驚くことではない。表現力が非常に高く、n個の事例からなるどんなデータセットについても、たとえ無作為に割り当てられたものでも任意のラベルに完璧に当てはまるパラメータの組を見つけられるようなモデルのクラスを想像してほしい。この場合、訓練データに完璧に当てはまったとしても、汎化誤差について何を結論できるだろうか。わかっているかぎりでは、汎化誤差は当てずっぽうよりよくないかもしれない。
In general, absent any restriction on our model class, we cannot conclude, based on fitting the training data alone, that our model has discovered any generalizable pattern (Vapnik et al., 1994). On the other hand, if our model class was not capable of fitting arbitrary labels, then it must have discovered a pattern. Learning-theoretic ideas about model complexity derived some inspiration from the ideas of Karl Popper, an influential philosopher of science, who formalized the criterion of falsifiability. According to Popper, a theory that can explain any and all observations is not a scientific theory at all! After all, what has it told us about the world if it has not ruled out any possibility? In short, what we want is a hypothesis that could not explain any observations we might conceivably make and yet nevertheless happens to be compatible with those observations that we in fact make.
英語のヒント
一般に、モデルのクラスに何の制約もなければ、訓練データへの当てはまりだけにもとづいて、モデルが汎化できるパターンを見つけたと結論することはできない(Vapnik et al., 1994)。一方、モデルのクラスが任意のラベルには当てはまれないなら、モデルはパターンを見つけたに違いない。モデルの複雑さについての学習理論の考え方は、反証可能性の基準を定式化した、影響力のある科学哲学者カール・ポパーの考えから着想の一部を得た。ポパーによれば、ありとあらゆる観測を説明できる理論は、そもそも科学的な理論ではない。なにしろ、どんな可能性も排除しないなら、それは世界について何を教えてくれたのか。要するに、私たちが望むのは、考えうるどんな観測でも説明できるわけではないのに、実際に行った観測とはたまたま両立する仮説である。
Now what precisely constitutes an appropriate notion of model complexity is a complex matter. Often, models with more parameters are able to fit a greater number of arbitrarily assigned labels. However, this is not necessarily true. For instance, kernel methods operate in spaces with infinite numbers of parameters, yet their complexity is controlled by other means (Schölkopf and Smola, 2002). One notion of complexity that often proves useful is the range of values that the parameters can take. Here, a model whose parameters are permitted to take arbitrary values would be more complex. We will revisit this idea in the next section, when we introduce weight decay, your first practical regularization technique. Notably, it can be difficult to compare complexity among members of substantially different model classes (say, decision trees vs. neural networks).
英語のヒント
では、モデルの複雑さの適切な概念を正確に何が構成するかは、複雑な問題である。パラメータが多いモデルのほうが、任意に割り当てたラベルにより多く当てはまれることが多い。しかし、これは必ずしも正しくない。たとえばカーネル法は無限個のパラメータをもつ空間で働くが、その複雑さはほかの手段で制御されている(Schölkopf and Smola, 2002)。役に立つことの多い複雑さの概念の一つは、パラメータがとりうる値の範囲である。ここでは、パラメータが任意の値をとることを許されたモデルのほうが複雑である。この考えには次の節で、最初の実用的な正則化技術である重み減衰を紹介するときに立ち戻る。注目すべきことに、大きく異なるモデルのクラス(たとえば決定木とニューラルネットワーク)のあいだで複雑さを比べるのは難しいことがある。
At this point, we must stress another important point that we will revisit when introducing deep neural networks. When a model is capable of fitting arbitrary labels, low training error does not necessarily imply low generalization error. However, it does not necessarily imply high generalization error either! All we can say with confidence is that low training error alone is not enough to certify low generalization error. Deep neural networks turn out to be just such models: while they generalize well in practice, they are too powerful to allow us to conclude much on the basis of training error alone. In these cases we must rely more heavily on our holdout data to certify generalization after the fact. Error on the holdout data, i.e., validation set, is called the validation error.
英語のヒント
ここで、深いニューラルネットワークを紹介するときに立ち戻る、もう一つの大事な点を強調しておかなければならない。モデルが任意のラベルに当てはまれるとき、訓練誤差が低いことは必ずしも汎化誤差が低いことを意味しない。しかし、汎化誤差が高いことを必ずしも意味するわけでもない。自信をもって言えるのは、訓練誤差が低いことだけでは、汎化誤差が低いことを保証するのに足りない、ということだけである。深いニューラルネットワークは、まさにそういうモデルであることがわかる。実際にはよく汎化するが、訓練誤差だけにもとづいて多くを結論できるようにするには強力すぎる。こうした場合、汎化を事後に保証するには、取り分けておいたデータにより大きく頼らなければならない。取り分けておいたデータ、つまり検証集合での誤差を、検証誤差という。