liveBook · Manning

Grid search

As explained in Designing Deep Learning Systems: A guide for software engineers

A hyperparameter search method that evaluates configurations formed from the Cartesian product of specified candidate values.

Grid search evaluates hyperparameter configurations formed from the Cartesian product of user-specified candidate values, then runs an HPO trial for each configuration. section 5.2.2

Learning rate and batch size

Define learning-rate candidates {0.1, 0.005, 0.001} and batch-size candidates {10, 40, 100}. The grid includes combinations such as (0.1, 10), (0.1, 40), and (0.1, 100), which become trial configurations. section 5.2.2

Account for these operational trade-offs:

  • Use bounded candidate sets when the search space is small and explicitly enumerable. section 5.2.2
  • Expect evaluations to grow exponentially as hyperparameter count or search-space size increases. section 5.2.2
  • Avoid assuming equal allocation is efficient: grid search can waste compute in nonoptimal regions while undersampling promising ones. section 5.2.2
Figure 5.4 Comparison of grid search and random search for minimizing a function with one important and one unimportant parameter. (Source: Figure 1.1. of “Hyperparameter Optimization,” by Matthias Feurer and Frank Hutter, in AutoML: Methods, Systems, Challenges, eds. Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren; Springer, 2019. www.automl.org/wp-content/uploads/2019/05/AutoML_Book_Chapter1.pdf)

Compare grid search with random search across important and unimportant parameters. section 5.2.2

How Designing Deep Learning Systems: A guide for software engineers covers it

How deep it goes
Defines Cartesian-product construction and operational drawbacks, but defers mathematical reasoning and implementation details.
Examples
Uses learning-rate and batch-size candidate sets to construct configurations such as (0.1, 10).
What it assumes
Assumes identifiable hyperparameters and finite candidate values, while defining search-space construction from those values.
What you can do after
Operate/configure grid search by defining candidate values, generating their Cartesian product, and launching trials for each combination.
How it connects
Connects hyperparameter optimization with model-free optimization, search spaces, Cartesian products, and random search.

Also explained in

Compare how 6 books explain grid search →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Designing Deep Learning Systems: A guide for software engineers. The section links point to the parts of the book it draws on.