プリンキピア

第16章自然言語処理:応用

16.7.5. Exercises16.7.5 練習問題

  1. Fine-tune a much larger pretrained BERT model that is about as big as the original BERT base model if your computational resource allows. Set arguments in the load_pretrained_model function as: replacing ‘bert.small’ with ‘bert.base’, increasing values of num_hiddens=256, ffn_num_hiddens=512, num_heads=4, and num_blks=2 to 768, 3072, 12, and 12, respectively. By increasing fine-tuning epochs (and possibly tuning other hyperparameters), can you get a testing accuracy higher than 0.86?
    英語のヒント
    計算資源が許すなら、元のBERTの基本モデルとほぼ同じ大きさの、ずっと大きな事前学習済みBERTモデルを微調整せよ。load_pretrained_model関数の引数を次のように設定せよ。「bert.small」を「bert.base」に置き換え、num_hiddens=256、ffn_num_hiddens=512、num_heads=4、num_blks=2の値をそれぞれ768、3072、12、12に増やす。微調整のエポック数を増やせば(そしておそらくほかのハイパーパラメータを調整すれば)、0.86より高いテストの正解率が得られるか。
  2. How to truncate a pair of sequences according to their ratio of length? Compare this pair truncation method and the one used in the SNLIBERTDataset class. What are their pros and cons?
    英語のヒント
    系列の対を、その長さの比に応じてどう切り詰めればよいか。この対の切り詰めの方法と、SNLIBERTDatasetクラスで使った方法を比べよ。それぞれの長所と短所は何か。