プリンキピア

第4章分類のための線形ニューラルネットワーク

4.1.4. Summary and Discussion4.1.4 まとめと考察

In this section, we encountered the first nontrivial loss function, allowing us to optimize over discrete output spaces. Key in its design was that we took a probabilistic approach, treating discrete categories as instances of draws from a probability distribution. As a side effect, we encountered the softmax, a convenient activation function that transforms outputs of an ordinary neural network layer into valid discrete probability distributions. We saw that the derivative of the cross-entropy loss when combined with softmax behaves very similarly to the derivative of squared error; namely by taking the difference between the expected behavior and its prediction. And, while we were only able to scratch the very surface of it, we encountered exciting connections to statistical physics and information theory.
英語のヒント
この節では、離散的な出力空間で最適化できるようにする、最初の自明でない損失関数に出会った。その設計の鍵は、確率的な手法をとり、離散的なカテゴリーを確率分布からの取り出しの例として扱ったことだった。その副産物として、普通のニューラルネットワークの層の出力を正当な離散確率分布に変換する、便利な活性化関数であるソフトマックスに出会った。ソフトマックスと組み合わせた交差エントロピー損失の導関数は、二乗誤差の導関数とよく似た振る舞いをすることを見た。つまり、期待される振る舞いと予測との差をとるのである。そして、ほんの表面をなでることしかできなかったが、統計物理学と情報理論との刺激的なつながりにも出会った。
While this is enough to get you on your way, and hopefully enough to whet your appetite, we hardly dived deep here. Among other things, we skipped over computational considerations. Specifically, for any fully connected layer with d inputs and q outputs, the parametrization and computational cost is 𝒪(dq), which can be prohibitively high in practice. Fortunately, this cost of transforming d inputs into q outputs can be reduced through approximation and compression. For instance Deep Fried Convnets (Yang et al., 2015) uses a combination of permutations, Fourier transforms, and scaling to reduce the cost from quadratic to log-linear. Similar techniques work for more advanced structural matrix approximations (Sindhwani et al., 2015). Lastly, we can use quaternion-like decompositions to reduce the cost to 𝒪(dqn), again if we are willing to trade off a small amount of accuracy for computational and storage cost (Zhang et al., 2021) based on a compression factor n. This is an active area of research. What makes it challenging is that we do not necessarily strive for the most compact representation or the smallest number of floating point operations but rather for the solution that can be executed most efficiently on modern GPUs.
英語のヒント
これで先に進むには十分で、願わくは興味をそそるにも十分だろうが、ここではほとんど深く潜らなかった。とりわけ、計算上の考慮を飛ばした。具体的には、入力がd個、出力がq個の全結合層では、パラメータ化と計算の費用は𝒪(dq)で、実際には途方もなく高くなりうる。幸い、d個の入力をq個の出力に変換するこの費用は、近似と圧縮によって減らせる。たとえばDeep Fried Convnets(Yang et al., 2015)は、置換、フーリエ変換、スケーリングを組み合わせて、費用を2乗から対数線形に減らす。同様の技術は、より高度な構造化行列の近似にも使える(Sindhwani et al., 2015)。最後に、圧縮率nにもとづき、計算と保存の費用のために少しの正確さを犠牲にしてよいなら、四元数のような分解を使って費用を𝒪(dqn)に減らせる(Zhang et al., 2021)。これは活発な研究分野である。難しいのは、必ずしも最もコンパクトな表現や最も少ない浮動小数点演算を目指すのではなく、現代のGPUで最も効率よく実行できる解を目指す点である。