liveBook · Manning

Tuner

As explained in Deep Learning with R, Third Edition

A tuner is a hyperparameter-search component that selects configurations, builds and trains models, and records their metrics.

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.

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains search-space declaration, tuner configuration, execution, result querying, and retraining, without deriving optimization algorithms.
Examples
Uses an MNIST multilayer perceptron that tunes dense-layer units and optimizer choices, then compares selected models on held-out test data.
What it assumes
Assumes a compiled Keras model, training and validation data, and tunable hyperparameters exposed through a model-building function.
What you can do after
Apply it via KerasTuner to define a search space, run trials, retrieve promising configurations, retrain models, and evaluate them.
How it connects
Connects hyperparameter optimization with search spaces, model-building functions, HyperModel, Bayesian optimization, objectives, and early stopping.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.