第4章分類のための線形ニューラルネットワーク
4.1.5. Exercises4.1.5 練習問題
- We can explore the connection between exponential families and softmax in some more depth.
英語のヒント
指数型分布族とソフトマックスのつながりを、もう少し深く探ってみよう。- Compute the second derivative of the cross-entropy loss for softmax.
英語のヒント
ソフトマックスについて、交差エントロピー損失の2階導関数を計算せよ。 - Compute the variance of the distribution given by and show that it matches the second derivative computed above.
英語のヒント
で与えられる分布の分散を計算し、それが上で計算した2階導関数と一致することを示せ。
- Assume that we have three classes which occur with equal probability, i.e., the probability vector is .
英語のヒント
同じ確率で起こる三つのクラスがあるとする。つまり、確率ベクトルはである。- What is the problem if we try to design a binary code for it?
英語のヒント
これに二進符号を設計しようとすると何が問題か。 - Can you design a better code? Hint: what happens if we try to encode two independent observations? What if we encode observations jointly?
英語のヒント
よりよい符号を設計できるか。ヒント:二つの独立な観測を符号化しようとすると何が起きるか。個の観測をまとめて符号化したらどうか。
- When encoding signals transmitted over a physical wire, engineers do not always use binary codes. For instance, PAM-3 uses three signal levels as opposed to two levels . How many ternary units do you need to transmit an integer in the range ? Why might this be a better idea in terms of electronics?
英語のヒント
物理的な配線で送られる信号を符号化するとき、技術者はいつも二進符号を使うわけではない。たとえばPAM-3は、二つの水準ではなく、三つの信号水準を使う。範囲の整数を送るには、三進の単位がいくつ必要か。電子工学の観点で、これがよりよい考えでありうるのはなぜか。 - The Bradley–Terry model uses a logistic model to capture preferences. For a user to choose between apples and oranges one assumes scores and . Our requirements are that larger scores should lead to a higher likelihood in choosing the associated item and that the item with the largest score is the most likely one to be chosen (Bradley and Terry, 1952).
英語のヒント
ブラッドリー–テリーモデルは、ロジスティックモデルを使って好みをとらえる。利用者がリンゴとオレンジのどちらかを選ぶとき、得点とを仮定する。要件は、得点が大きいほど対応する品物を選ぶ可能性が高くなること、そして最大の得点をもつ品物が最も選ばれやすいことである(Bradley and Terry, 1952)。- Prove that softmax satisfies this requirement.
英語のヒント
ソフトマックスがこの要件を満たすことを証明せよ。 - What happens if you want to allow for a default option of choosing neither apples nor oranges? Hint: now the user has three choices.
英語のヒント
リンゴもオレンジも選ばないという既定の選択肢を許したいとしたら、どうなるか。ヒント:今度は利用者に選択肢が三つある。
- Softmax gets its name from the following mapping: .
英語のヒント
ソフトマックスという名前は、次の写像に由来する。- Prove that .
英語のヒント
を証明せよ。 - How small can you make the difference between both functions? Hint: without loss of generality you can set and .
英語のヒント
両方の関数の差をどれほど小さくできるか。ヒント:一般性を失うことなく、かつとしてよい。 - Prove that this holds for , provided that .
英語のヒント
であれば、これがについても成り立つことを証明せよ。 - Show that for we have .
英語のヒント
のとき、となることを示せ。 - Construct an analogous softmin function.
英語のヒント
同様のソフトミン関数を作れ。 - Extend this to more than two numbers.
英語のヒント
これを三つ以上の数に拡張せよ。
- The function is sometimes also referred to as the log-partition function.
英語のヒント
関数は、対数分配関数と呼ばれることもある。- Prove that the function is convex. Hint: to do so, use the fact that the first derivative amounts to the probabilities from the softmax function and show that the second derivative is the variance.
英語のヒント
この関数が凸であることを証明せよ。ヒント:そのためには、1階導関数がソフトマックス関数の確率になることを使い、2階導関数が分散であることを示せ。 - Show that is translation invariant, i.e., .
英語のヒント
が平行移動に対して不変であること、つまりであることを示せ。 - What happens if some of the coordinates are very large? What happens if they’re all very small?
英語のヒント
座標の一部がとても大きいと何が起きるか。すべてがとても小さいとどうなるか。 - Show that if we choose we end up with a numerically stable implementation.
英語のヒント
を選べば、数値的に安定した実装になることを示せ。
- Assume that we have some probability distribution . Suppose we pick another distribution with for .
英語のヒント
何らかの確率分布があるとする。についてとなる、別の分布を選ぶとしよう。- Which choice of corresponds to doubling the temperature? Which choice corresponds to halving it?
英語のヒント
をどう選べば、温度を2倍にすることに対応するか。どう選べば半分にすることに対応するか。 - What happens if we let the temperature approach ?
英語のヒント
温度をに近づけると何が起きるか。 - What happens if we let the temperature approach ?
英語のヒント
温度をに近づけると何が起きるか。