プリンキピア

第5章多層パーセプトロン

5.7.7. Model Selection5.7.7 モデル選択

In this example, we pick an untuned set of hyperparameters and leave it up to the reader to improve the model. Finding a good choice can take time, depending on how many variables one optimizes over. With a large enough dataset, and the normal sorts of hyperparameters, K-fold cross-validation tends to be reasonably resilient against multiple testing. However, if we try an unreasonably large number of options we might find that our validation performance is no longer representative of the true error.
英語のヒント
この例では、調整していないハイパーパラメータの組を選び、モデルの改善は読者に任せる。よい選択を見つけるには、いくつの変数について最適化するかによって、時間がかかることがある。十分に大きなデータセットとふつうの種類のハイパーパラメータなら、K分割交差検証は、多重検定に対してそれなりに頑丈である傾向がある。しかし、不合理なほど多くの選択肢を試すと、検証での性能がもはや真の誤差を代表していないことに気づくかもしれない。
trainer = d2l.Trainer(max_epochs=10)
models = k_fold(trainer, data, k=5, lr=0.01)
average validation log mse = 0.17325432986021042
Notice that sometimes the number of training errors for a set of hyperparameters can be very low, even as the number of errors on K-fold cross-validation grows considerably higher. This indicates that we are overfitting. Throughout training you will want to monitor both numbers. Less overfitting might indicate that our data can support a more powerful model. Massive overfitting might suggest that we can gain by incorporating regularization techniques.
英語のヒント
あるハイパーパラメータの組で、訓練誤差の数がとても少なくなる一方で、K分割交差検証での誤差の数がかなり多くなることがあることに注意してほしい。これは過学習していることを示している。訓練全体を通じて、両方の数を監視したくなるだろう。過学習が少なければ、データがもっと強力なモデルを支えられることを示しているかもしれない。過学習が大きければ、正則化の手法を組み込むことで改善できることを示唆しているかもしれない。