第4章分類のための線形ニューラルネットワーク
4.6. Generalization in Classification4.6 分類における汎化
So far, we have focused on how to tackle multiclass classification problems by training (linear) neural networks with multiple outputs and softmax functions. Interpreting our model’s outputs as probabilistic predictions, we motivated and derived the cross-entropy loss function, which calculates the negative log likelihood that our model (for a fixed set of parameters) assigns to the actual labels. And finally, we put these tools into practice by fitting our model to the training set. However, as always, our goal is to learn general patterns, as assessed empirically on previously unseen data (the test set). High accuracy on the training set means nothing. Whenever each of our inputs is unique (and indeed this is true for most high-dimensional datasets), we can attain perfect accuracy on the training set by just memorizing the dataset on the first training epoch, and subsequently looking up the label whenever we see a new image. And yet, memorizing the exact labels associated with the exact training examples does not tell us how to classify new examples. Absent further guidance, we might have to fall back on random guessing whenever we encounter new examples.
英語のヒント
ここまでは、複数の出力とソフトマックス関数をもつ(線形の)ニューラルネットワークを訓練することで、多クラス分類の問題にどう取り組むかに焦点を当ててきた。モデルの出力を確率的な予測と解釈して、交差エントロピー損失関数の動機を説明し、導出した。この関数は、(固定したパラメータの組について)モデルが実際のラベルに割り当てる負の対数尤度を計算する。そして最後に、モデルを訓練集合に当てはめることで、これらの道具を実地に使った。しかし、いつものとおり、目標は一般的なパターンを学ぶことであり、それはこれまで見たことのないデータ(テスト集合)で経験的に評価される。訓練集合での高い正解率には何の意味もない。各入力がそれぞれ一意であるとき(そして実際、ほとんどの高次元のデータセットではそうである)、最初の訓練エポックでデータセットを丸暗記し、その後は新しい画像を見るたびにラベルを引けば、訓練集合で完璧な正解率を達成できる。それでも、正確な訓練事例に対応する正確なラベルを暗記しても、新しい事例をどう分類すればよいかはわからない。それ以上の手がかりがなければ、新しい事例に出会うたびに、当てずっぽうに頼るしかないかもしれない。
A number of burning questions demand immediate attention:
英語のヒント
いくつかの差し迫った問いに、すぐに目を向ける必要がある。
- How many test examples do we need to give a good estimate of the accuracy of our classifiers on the underlying population?
英語のヒント
背後にある母集団での分類器の正解率をよく推定するには、テスト事例がいくつ必要か。 - What happens if we keep evaluating models on the same test repeatedly?
英語のヒント
同じテストでモデルを繰り返し評価し続けると、何が起きるか。 - Why should we expect that fitting our linear models to the training set should fare any better than our naive memorization scheme?
英語のヒント
線形モデルを訓練集合に当てはめるほうが、素朴な丸暗記のやり方より少しでもうまくいくと期待すべきなのはなぜか。
Whereas Section 3.6 introduced the basics of overfitting and generalization in the context of linear regression, this chapter will go a little deeper, introducing some of the foundational ideas of statistical learning theory. It turns out that we often can guarantee generalization a priori: for many models, and for any desired upper bound on the generalization gap , we can often determine some required number of samples such that if our training set contains at least samples, our empirical error will lie within of the true error, for any data generating distribution. Unfortunately, it also turns out that while these sorts of guarantees provide a profound set of intellectual building blocks, they are of limited practical utility to the deep learning practitioner. In short, these guarantees suggest that ensuring generalization of deep neural networks a priori requires an absurd number of examples (perhaps trillions or more), even when we find that, on the tasks we care about, deep neural networks typically generalize remarkably well with far fewer examples (thousands). Thus deep learning practitioners often forgo a priori guarantees altogether, instead employing methods that have generalized well on similar problems in the past, and certifying generalization post hoc through empirical evaluations. When we get to Section 5, we will revisit generalization and provide a light introduction to the vast scientific literature that has sprung in attempts to explain why deep neural networks generalize in practice.
英語のヒント
3.6節では線形回帰の文脈で過学習と汎化の基礎を紹介したが、この章ではもう少し深く進み、統計的学習理論の基礎となる考え方のいくつかを紹介する。実は、汎化はしばしば事前に保証できる。多くのモデルについて、そして汎化ギャップに望むどんな上界についても、ある必要な標本数を決められることが多い。その数は、訓練集合に少なくとも個の標本が含まれていれば、データを生成するどんな分布についても、経験誤差が真の誤差から以内に収まるというものである。残念ながら、こうした種類の保証は知的な土台となる深い部品の一式を与えてくれるものの、深層学習の実践者にとって実用上の有用性は限られていることもわかる。要するに、こうした保証によれば、深いニューラルネットワークの汎化を事前に確かにするには、ばかげた数の事例(おそらく数兆かそれ以上)が必要になる。関心のある課題では、深いニューラルネットワークがふつうはるかに少ない事例(数千)で驚くほどよく汎化するのが見られるときでさえ、そうである。そのため、深層学習の実践者は事前の保証をすっかりあきらめることが多い。代わりに、過去に似た問題でよく汎化した手法を使い、経験的な評価を通じて事後に汎化を確かめるのである。第5章では、汎化を再び取り上げ、深いニューラルネットワークが実際に汎化するのはなぜかを説明しようとして生まれた膨大な科学文献を、軽く紹介する。