第4章分類のための線形ニューラルネットワーク
4.1.3. Information Theory Basics4.1.3 情報理論の基礎
Many deep learning papers use intuition and terms from information theory. To make sense of them, we need some common language. This is a survival guide. Information theory deals with the problem of encoding, decoding, transmitting, and manipulating information (also known as data).
英語のヒント
深層学習の論文の多くは、情報理論の直観と用語を使う。それを理解するには、共通の言葉が必要である。これはそのための生き残りの手引きである。情報理論は、情報(データとも呼ばれる)の符号化、復号、伝送、操作の問題を扱う。
4.1.3.1. Entropy4.1.3.1 エントロピー
The central idea in information theory is to quantify the amount of information contained in data. This places a limit on our ability to compress data. For a distribution its entropy, , is defined as:
英語のヒント
情報理論の中心となる考えは、データに含まれる情報の量を数値で表すことである。これは、データを圧縮できる能力に限界を課す。分布について、そのエントロピーは次のように定義される。
(4.1.11)
One of the fundamental theorems of information theory states that in order to encode data drawn randomly from the distribution , we need at least “nats” to encode it (Shannon, 1948). If you wonder what a “nat” is, it is the equivalent of bit but when using a code with base rather than one with base 2. Thus, one nat is bit.
英語のヒント
情報理論の基本定理の一つは、分布から無作為に取り出したデータを符号化するには、少なくとも「ナット」が必要だと述べる(Shannon, 1948)。「ナット」とは何かと思うなら、それは2を底とする符号ではなくを底とする符号を使うときの、ビットに相当するものである。したがって、1ナットはビットである。
4.1.3.2. Surprisal4.1.3.2 驚き
You might be wondering what compression has to do with prediction. Imagine that we have a stream of data that we want to compress. If it is always easy for us to predict the next token, then this data is easy to compress. Take the extreme example where every token in the stream always takes the same value. That is a very boring data stream! And not only it is boring, but it is also easy to predict. Because the tokens are always the same, we do not have to transmit any information to communicate the contents of the stream. Easy to predict, easy to compress.
英語のヒント
圧縮が予測とどう関係するのか不思議に思うかもしれない。圧縮したいデータの流れがあると想像してほしい。次のトークンを予測するのがいつも簡単なら、このデータは圧縮しやすい。流れのなかのすべてのトークンがいつも同じ値をとる極端な例を考えよう。これはとても退屈なデータの流れである。そして退屈なだけでなく、予測もしやすい。トークンはいつも同じなので、流れの中身を伝えるのに情報を一つも送る必要がない。予測しやすければ、圧縮しやすいのである。
However if we cannot perfectly predict every event, then we might sometimes be surprised. Our surprise is greater when an event is assigned lower probability. Claude Shannon settled on to quantify one’s surprisal at observing an event having assigned it a (subjective) probability . The entropy defined in (4.1.11) is then the expected surprisal when one assigned the correct probabilities that truly match the data-generating process.
英語のヒント
しかし、すべての出来事を完璧には予測できないなら、ときには驚くことがある。出来事に割り当てられた確率が低いほど、驚きは大きい。クロード・シャノンは、ある出来事に(主観的な)確率を割り当てていたときに、それを観測した人の驚きを数値で表すものとしてに落ち着いた。そうすると、(4.1.11)で定義したエントロピーは、データを生成する過程に本当に一致する正しい確率を割り当てた人の、期待される驚きである。
4.1.3.3. Cross-Entropy Revisited4.1.3.3 交差エントロピー再訪
So if entropy is the level of surprise experienced by someone who knows the true probability, then you might be wondering, what is cross-entropy? The cross-entropy from to , denoted , is the expected surprisal of an observer with subjective probabilities upon seeing data that was actually generated according to probabilities . This is given by . The lowest possible cross-entropy is achieved when . In this case, the cross-entropy from to is .
英語のヒント
では、エントロピーが本当の確率を知っている人の経験する驚きの水準だとしたら、交差エントロピーとは何なのかと思うかもしれない。と表される、からへの交差エントロピーは、主観的な確率をもつ観測者が、実際には確率に従って生成されたデータを見たときの、期待される驚きである。これはで与えられる。交差エントロピーが最も低くなるのはのときである。この場合、からへの交差エントロピーはである。
In short, we can think of the cross-entropy classification objective in two ways: (i) as maximizing the likelihood of the observed data; and (ii) as minimizing our surprisal (and thus the number of bits) required to communicate the labels.
英語のヒント
要するに、交差エントロピーによる分類の目的は、二通りに考えられる。(i)観測データの尤度を最大にすること。(ii)ラベルを伝えるのに必要な驚き(したがってビット数)を最小にすること。