プリンキピア

第15章自然言語処理:事前学習

15.2. Approximate Training15.2 近似的な訓練

Recall our discussions in Section 15.1. The main idea of the skip-gram model is using softmax operations to calculate the conditional probability of generating a context word wo based on the given center word wc in (15.1.4), whose corresponding logarithmic loss is given by the opposite of (15.1.7).
英語のヒント
15.1節での議論を思い出そう。スキップグラムモデルの主な考え方は、(15.1.4)で、与えられた中心語wcにもとづいて文脈語woを生成する条件付き確率を、ソフトマックス演算を使って計算することであり、それに対応する対数損失は(15.1.7)の符号を反転したもので与えられる。
Due to the nature of the softmax operation, since a context word may be anyone in the dictionary 𝒱, the opposite of (15.1.7) contains the summation of items as many as the entire size of the vocabulary. Consequently, the gradient calculation for the skip-gram model in (15.1.8) and that for the continuous bag-of-words model in (15.1.15) both contain the summation. Unfortunately, the computational cost for such gradients that sum over a large dictionary (often with hundreds of thousands or millions of words) is huge!
英語のヒント
ソフトマックス演算の性質上、文脈語は辞書𝒱のどの語でもありうるので、(15.1.7)の符号を反転したものは、語彙の大きさ全体と同じだけの数の項の和を含む。その結果、(15.1.8)のスキップグラムモデルの勾配の計算も、(15.1.15)の連続バッグオブワーズモデルの勾配の計算も、どちらもこの和を含む。あいにく、大きな辞書(しばしば数十万語から数百万語)にわたって和をとるこうした勾配の計算コストは莫大である!
In order to reduce the aforementioned computational complexity, this section will introduce two approximate training methods: negative sampling and hierarchical softmax. Due to the similarity between the skip-gram model and the continuous bag of words model, we will just take the skip-gram model as an example to describe these two approximate training methods.
英語のヒント
前に述べた計算の複雑さを減らすため、この節では二つの近似的な訓練方法、つまり負例サンプリングと階層的ソフトマックスを紹介する。スキップグラムモデルと連続バッグオブワーズモデルは似ているので、スキップグラムモデルだけを例にとって、この二つの近似的な訓練方法を説明する。