第8章現代の畳み込みニューラルネットワーク
8.2.3. Training8.2.3 訓練
Since VGG-11 is computationally more demanding than AlexNet we construct a network with a smaller number of channels. This is more than sufficient for training on Fashion-MNIST. The model training process is similar to that of AlexNet in Section 8.1. Again observe the close match between validation and training loss, suggesting only a small amount of overfitting.
英語のヒント
VGG-11はAlexNetより計算の負荷が大きいので、チャネルの数を減らしたネットワークを作る。Fashion-MNISTで訓練するには、これで十分すぎるほどである。モデルの訓練の手順は、8.1節のAlexNetのものと似ている。ここでも、検証損失と訓練損失がよく一致しており、過学習がわずかしかないことがわかる。
model = VGG(arch=((1, 16), (1, 32), (2, 64), (2, 128), (2, 128)), lr=0.01)
trainer = d2l.Trainer(max_epochs=10, num_gpus=1)
data = d2l.FashionMNIST(batch_size=128, resize=(224, 224))
model.apply_init([next(iter(data.get_dataloader(True)))[0]], d2l.init_cnn)
trainer.fit(model, data)