第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 based on the given center word in (15.1.4), whose corresponding logarithmic loss is given by the opposite of (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!
英語のヒント
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.
英語のヒント
前に述べた計算の複雑さを減らすため、この節では二つの近似的な訓練方法、つまり負例サンプリングと階層的ソフトマックスを紹介する。スキップグラムモデルと連続バッグオブワーズモデルは似ているので、スキップグラムモデルだけを例にとって、この二つの近似的な訓練方法を説明する。