Replies: 1 comment 1 reply
-
Sorry, I do not see a clear way to do it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We can look at the code here for this question: https://keras.io/guides/keras_tuner/getting_started/
I have defined a build_model function similar to the example. My tuner definition is similar as well except I'm using BayesOptimization.
I then do search with max epochs = 900 and have a stop_early callback
That works fine and a best model is found. Then I get the 10 best models and save the best model in best_model.
Now, I'm trying to retrain the model with all of the training data as suggested. The example shows epochs=1 when retraining.
model.fit(x=x_all, y=y_all, epochs=1) #in the example, this isn't my code
I want to train for the same number of epochs that the stop_early callback found when doing the optimization. I haven't found a way to look up the best_step value. I even tried manually checking the trial_nnn folders in the project folder but the trial.json file shows "best_step": 0, for ALL of the trials. It seems like the best_step value isn't being saved.
How can I find out the number of epochs in each trial that the stop_early callback found the best weights? I want to set epochs equal to that value when I call model.fit().
Beta Was this translation helpful? Give feedback.
All reactions