プリンキピア

第14章コンピュータビジョン

14.2.4. Exercises14.2.4 練習問題

  1. Keep increasing the learning rate of finetune_net. How does the accuracy of the model change?
    英語のヒント
    finetune_netの学習率を上げ続けよ。モデルの正解率はどう変わるか。
  2. Further adjust hyperparameters of finetune_net and scratch_net in the comparative experiment. Do they still differ in accuracy?
    英語のヒント
    比較実験で、finetune_netとscratch_netのハイパーパラメータをさらに調整せよ。それでも正解率に違いはあるか。
  3. Set the parameters before the output layer of finetune_net to those of the source model and do not update them during training. How does the accuracy of the model change? You can use the following code.
    英語のヒント
    finetune_netの出力層より前のパラメータをソースモデルのものに設定し、訓練のあいだ更新しないようにせよ。モデルの正解率はどう変わるか。次のコードを使える。
for param in finetune_net.parameters():
    param.requires_grad = False
  1. In fact, there is a “hotdog” class in the ImageNet dataset. Its corresponding weight parameter in the output layer can be obtained via the following code. How can we leverage this weight parameter?
    英語のヒント
    実は、ImageNetのデータセットには「hotdog」クラスがある。出力層でそれに対応する重みのパラメータは、次のコードで得られる。この重みのパラメータをどう活用できるか。
weight = pretrained_net.fc.weight
hotdog_w = torch.split(weight.data, 1, dim=0)[934]
hotdog_w.shape
torch.Size([1, 512])