プリンキピア

第5章多層パーセプトロン

5.4.2. Parameter Initialization5.4.2 パラメータの初期化

One way of addressing—or at least mitigating—the issues raised above is through careful initialization. As we will see later, additional care during optimization and suitable regularization can further enhance stability.
英語のヒント
上で挙げた問題に対処する、あるいは少なくとも和らげる一つの方法は、注意深い初期化である。後で見るように、最適化のあいだの追加の注意と適切な正則化によって、安定性をさらに高められる。

5.4.2.1. Default Initialization5.4.2.1 既定の初期化

In the previous sections, e.g., in Section 3.5, we used a normal distribution to initialize the values of our weights. If we do not specify the initialization method, the framework will use a default random initialization method, which often works well in practice for moderate problem sizes.
英語のヒント
前の節、たとえば3.5節では、正規分布を使って重みの値を初期化した。初期化の方法を指定しなければ、フレームワークは既定の無作為な初期化の方法を使う。これは、ほどほどの大きさの問題なら、実際にはうまくいくことが多い。

5.4.2.2. Xavier Initialization5.4.2.2 Xavierの初期化

Let’s look at the scale distribution of an output oi for some fully connected layer without nonlinearities. With nin inputs xj and their associated weights wij for this layer, an output is given by
英語のヒント
非線形性のない、ある全結合層について、出力oiの大きさの分布を見てみよう。この層へのnin個の入力xjと、それに対応する重みwijがあるとき、出力は次で与えられる。
oi=∑j=1ninwijxj.(5.4.3)
The weights wij are all drawn independently from the same distribution. Furthermore, let’s assume that this distribution has zero mean and variance σ2. Note that this does not mean that the distribution has to be Gaussian, just that the mean and variance need to exist. For now, let’s assume that the inputs to the layer xj also have zero mean and variance γ2 and that they are independent of wij and independent of each other. In this case, we can compute the mean of oi:
英語のヒント
重みwijはすべて、同じ分布から独立に取り出される。さらに、この分布の平均は0で、分散はσ2だと仮定しよう。これは分布がガウス分布でなければならないという意味ではなく、平均と分散が存在すればよいということにすぎないことに注意してほしい。今のところ、層への入力xjも平均が0で分散がγ2であり、wijとは独立で、互いにも独立だと仮定しよう。この場合、oiの平均を計算できる。
E[oi]=∑j=1ninE[wijxj]=∑j=1ninE[wij]E[xj]=0,(5.4.4)
and the variance:
英語のヒント
また、分散は次のとおりである。
Var[oi]=E[oi2]−(E[oi])2=∑j=1ninE[wij2xj2]−0=∑j=1ninE[wij2]E[xj2]=ninσ2γ2.(5.4.5)
One way to keep the variance fixed is to set ninσ2=1. Now consider backpropagation. There we face a similar problem, albeit with gradients being propagated from the layers closer to the output. Using the same reasoning as for forward propagation, we see that the gradients’ variance can blow up unless noutσ2=1, where nout is the number of outputs of this layer. This leaves us in a dilemma: we cannot possibly satisfy both conditions simultaneously. Instead, we simply try to satisfy:
英語のヒント
分散を一定に保つ一つの方法は、ninσ2=1とすることである。今度は逆伝播を考えよう。そこでも似た問題に直面するが、ただし勾配は出力に近い層から伝播してくる。順伝播と同じ推論を使うと、noutσ2=1でないかぎり勾配の分散は爆発しうることがわかる。ここでnoutは、この層の出力の数である。これでジレンマに陥る。二つの条件を同時に満たすことはとてもできない。代わりに、単に次を満たそうとする。
12(nin+nout)σ2=1 or equivalently σ=2nin+nout.(5.4.6)
This is the reasoning underlying the now-standard and practically beneficial Xavier initialization, named after the first author of its creators (Glorot and Bengio, 2010). Typically, the Xavier initialization samples weights from a Gaussian distribution with zero mean and variance σ2=2nin+nout. We can also adapt this to choose the variance when sampling weights from a uniform distribution. Note that the uniform distribution U(−a,a) has variance a23. Plugging a23 into our condition on σ2 prompts us to initialize according to
英語のヒント
これが、今では標準となり実用上も有益なXavierの初期化の根底にある推論である。その名は、考案者たちの筆頭著者にちなむ(Glorot and Bengio, 2010)。ふつう、Xavierの初期化は、平均0、分散σ2=2nin+noutのガウス分布から重みを抽出する。一様分布から重みを抽出するときに分散を選ぶのにも、これを応用できる。一様分布U(−a,a)の分散はa23であることに注意してほしい。σ2についての条件にa23を代入すると、次に従って初期化すればよいことになる。
U(−6nin+nout,6nin+nout).(5.4.7)
Though the assumption for nonexistence of nonlinearities in the above mathematical reasoning can be easily violated in neural networks, the Xavier initialization method turns out to work well in practice.
英語のヒント
上の数学的な推論で置いた非線形性がないという仮定は、ニューラルネットワークでは簡単に破られうるが、Xavierの初期化の方法は実際にはうまく働くことがわかっている。

5.4.2.3. Beyond5.4.2.3 その先へ

The reasoning above barely scratches the surface of modern approaches to parameter initialization. A deep learning framework often implements over a dozen different heuristics. Moreover, parameter initialization continues to be a hot area of fundamental research in deep learning. Among these are heuristics specialized for tied (shared) parameters, super-resolution, sequence models, and other situations. For instance, Xiao et al. (2018) demonstrated the possibility of training 10,000-layer neural networks without architectural tricks by using a carefully-designed initialization method.
英語のヒント
上の推論は、パラメータの初期化への現代の手法の表面をかすめたにすぎない。深層学習のフレームワークは、十数種類もの異なる経験則を実装していることが多い。さらに、パラメータの初期化は、深層学習の基礎研究のなかで今も活発な分野であり続けている。そのなかには、結びつけられた(共有された)パラメータ、超解像、系列モデル、そのほかの状況に特化した経験則がある。たとえば、Xiao et al. (2018)は、注意深く設計された初期化の方法を使うことで、構造上の工夫なしに1万層のニューラルネットワークを訓練できる可能性を示した。
If the topic interests you we suggest a deep dive into this module’s offerings, reading the papers that proposed and analyzed each heuristic, and then exploring the latest publications on the topic. Perhaps you will stumble across or even invent a clever idea and contribute an implementation to deep learning frameworks.
英語のヒント
この話題に興味があるなら、このモジュールが提供するものに深く踏み込み、各経験則を提案し分析した論文を読み、それからこの話題の最新の出版物を探ることを勧める。ひょっとすると、賢い着想に出くわしたり、さらには発明したりして、深層学習のフレームワークに実装を寄与することになるかもしれない。