pythontensorflowhyperparameterskeras-tuner

Keras Tuner how to do basic grid search


Keras Tuner offers several tuning strategies in the form of tuner classes. I fail to find an implementation for the most basic tuning strategy, which is a grid search. Did I oversee it? If not, is there a way to force the strategy on one of the other tuner classes?


Solution

  • The RandomSearch Tuner can be abused to get the wanted behavior via the max_trials argument. Specifiying a value larger than the sum of elements in the defined hyperparamter space make the RandomSearch tuner run each hyperparameter combination once in a random order until all combinations are exhausted. The tuner will stop at that point even though max_trials is not exhausted and the grid search is done.