liveBook · Manning

Grid search

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

Grid search is a hyperparameter-optimization technique that evaluates configurations formed from a specified Cartesian product of candidate values.

Grid search automates hyperparameter optimization by mapping each parameter to discrete candidate values, forming a grid of combinations, and evaluating its cells methodically. section 5.3 section 5.7

A practical grid-search workflow:

  • Choose candidate values for each hyperparameter and represent them as a parameter grid. section 5.3.1
  • Use ParameterGrid to construct combinations across any number of dimensions. section 5.3.1
  • Evaluate configurations in sequence, then inspect plotted results to identify promising regions for further tuning. section 5.3 section 5.7

A four-parameter grid

A Python configuration varies middle_layer from 8 to 64 by six, learning_rate from 0.035 to 0.35 by 0.03, batch_size from 16 to 20 by four, and epochs from 200 to 225 by 25. The resulting grid contains 90 configurations; successive calls return configurations such as middle_layer=20 and middle_layer=26 with learning_rate=0.065.

Figure 5.9 Comparison of random search and grid search

Compare random sampling with grid traversal across a hyperparameter space; the figure makes systematic coverage and search patterns visible. section 5.3

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Explains grid construction, iteration, visualization, and resolution trade-offs, but stops short of evolutionary optimization.
Examples
Uses Python generators, scikit-learn ParameterGrid, a 90-cell neural-network configuration, and plotted search results.
What it assumes
Assumes familiarity with hyperparameters and neural-network training while demonstrating grid construction and iteration from implementation basics.
What you can do after
Apply grid search via Python and scikit-learn ParameterGrid to evaluate discrete hyperparameter combinations and inspect promising regions.
How it connects
Connects hyperparameter optimization with random search, evolutionary computation, dimensionality reduction, and PCA.

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 Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.