第9章リカレントニューラルネットワーク
9.5.7. Exercises9.5.7 練習問題
- Does the implemented language model predict the next token based on all the past tokens up to the very first token in The Time Machine?
英語のヒント
実装した言語モデルは、『タイム・マシン』の一番最初のトークンまでさかのぼって、過去のすべてのトークンにもとづいて次のトークンを予測しているか。 - Which hyperparameter controls the length of history used for prediction?
英語のヒント
予測に使う履歴の長さを制御しているのはどのハイパーパラメータか。 - Show that one-hot encoding is equivalent to picking a different embedding for each object.
英語のヒント
ワンホット符号化が、各対象に異なる埋め込みを選ぶことと同値であることを示せ。 - Adjust the hyperparameters (e.g., number of epochs, number of hidden units, number of time steps in a minibatch, and learning rate) to improve the perplexity. How low can you go while sticking with this simple architecture?
英語のヒント
パープレキシティを改善するために、ハイパーパラメータ(たとえば、エポック数、隠れユニットの数、ミニバッチの時間ステップの数、学習率)を調整せよ。この単純な構造のままで、どこまで下げられるか。 - Replace one-hot encoding with learnable embeddings. Does this lead to better performance?
英語のヒント
ワンホット符号化を、学習できる埋め込みに置き換えよ。それで性能はよくなるか。 - Conduct an experiment to determine how well this language model trained on The Time Machine works on other books by H. G. Wells, e.g., The War of the Worlds.
英語のヒント
『タイム・マシン』で訓練したこの言語モデルが、H. G. ウェルズのほかの本、たとえば『宇宙戦争』でどれくらいうまく働くかを確かめる実験を行え。 - Conduct another experiment to evaluate the perplexity of this model on books written by other authors.
英語のヒント
ほかの著者が書いた本で、このモデルのパープレキシティを評価する別の実験を行え。 - Modify the prediction method so as to use sampling rather than picking the most likely next character.
英語のヒント
最もありそうな次の文字を選ぶのではなく、サンプリングを使うように予測のメソッドを変えよ。- What happens?
英語のヒント
何が起きるか。 - Bias the model towards more likely outputs, e.g., by sampling from for .
英語のヒント
たとえばについてからサンプリングすることで、モデルをもっとありそうな出力の方へ偏らせよ。
- Run the code in this section without clipping the gradient. What happens?
英語のヒント
この節のコードを、勾配をクリップせずに実行せよ。何が起きるか。 - Replace the activation function used in this section with ReLU and repeat the experiments in this section. Do we still need gradient clipping? Why?
英語のヒント
この節で使った活性化関数をReLUに置き換え、この節の実験を繰り返せ。それでも勾配クリッピングは必要か。それはなぜか。