Early stopping with Keras and sklearn GridSearchCV cross-validation

前端 未结 4 1563
花落未央
花落未央 2020-12-13 04:58

I wish to implement early stopping with Keras and sklean\'s GridSearchCV.

The working code example below is modified from How to Grid Search Hyperparame

4条回答
  •  时光取名叫无心
    2020-12-13 05:10

    I disagree with desertnaut's answer above. With early stopping it is true that for a set of epoch counts you cannot tell which of them contributed to the best hyperparameter set found. But this was not the question to begin with. What the method did ask was "Given at maximum n epochs and using early stopping, what are the best hyperparameters?". Yes, early stopping will introduce further hyper parameters that you might or might not want to optimize with grid search, but this is true for any hyperparameter in your model. In fact I think early stopping during grid search makes way more sense than not doing so first but after grid search, since you can (at least mildly) reason about the hyperparameters it introduces.

提交回复
热议问题