A tuner automates hyperparameter search: it chooses a configuration, builds and trains the corresponding model, evaluates its metrics, and repeats the process. Instead of hardcoding values such as units = 32, a model-building function exposes ranges and choices that define the search space. section 18.1.1
MNIST model tuning
Prepare and split MNIST data, then call tuner$search() with validation data, batch size 128, 100 epochs, and validation-loss early stopping. Retrieve the top four configurations, determine a suitable epoch count, retrain on the full training set, and evaluate the resulting models on the test set.
