liveBook · Manning

Hyperparameter tuning

As explained in Advanced Algorithms and Data Structures

Parameter fine-tuning is the systematic refinement of tested parameter values around the most promising settings.

Hyperparameter tuning systematically searches tested parameter values, first locating the best order of magnitude and then refining values around the most promising settings. Keeping candidate lists short is important when several parameters must be evaluated in combination. section 18.2.4

A practical tuning protocol is:

  • Choose coarse, heterogeneously spaced values for each parameter. section 18.2.4
  • Measure results for the combinations of parameter values. section 18.2.4
  • Repeat the search around the most promising values, using narrower intervals. section 18.2.4

Refining mutation chance

Begin with mutation chances such as [0.01, 0.05, 0.1, 0.2, 0.5, 0.8, 1]. If 0.2 and 0.5 perform best, test intermediate values such as 0.15, 0.2, 0.25, 0.3, through 0.6. section 18.2.4

Table 18.2 Average best solution for the TSP genetic algorithm, varying the operators’ chance. The results are sorted by tour cost, and we highlighted the most significant rows. (view table figure)

Crossover

Adjacent swap

Random swap

Average tour cost

0.2

0

0.5

6326.447

0.3

0.002

0.5

6379.628

0.2

0.02

0.5

6409.664

0.1

0.002

0.5

6428.103

0.2

0

0.2

6555.593

0.2

0.2

0.5

6753.441

0.2

0.2

0.2

6823.971

0.2

0

0.7

7016.033

0

0

0.2

7110.798

0

0

0.7

7143.873

0.7

0

0.7

7818.061

0

0.7

0

10428.917

0.7

0

0

11655.949

0.2

0

0

15210.800

Compare average best TSP solutions while varying crossover, adjacent-swap, and random-swap chances. section 18.2.4

How Advanced Algorithms and Data Structures covers it

How deep it goes
Explains a coarse-to-fine protocol and combination costs, but does not develop a formal optimization method.
Examples
Uses mutation-chance ranges and a TSP table comparing crossover and swap-operator chances.
What it assumes
Assumes genetic-algorithm parameters and measured solution quality, while illustrating the search procedure from concrete values.
What you can do after
Apply coarse-to-fine search to select promising values for several genetic-algorithm parameters.
How it connects
Connects parameter tuning with genetic algorithms, mutation, crossover, elitism, and simulated annealing.

Also explained in

Compare how 18 books explain hyperparameter tuning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Advanced Algorithms and Data Structures. The section links point to the parts of the book it draws on.