TensorTau PathToAGI Doing Machine Learning Honestly Level 05

Level 05 · Doing Machine Learning Honestly · Chapter 065

Hyperparameter Search

How do we choose settings that learning itself does not learn?

1. Parameters versus hyperparameters

Weights are learned from training data. Choices such as tree depth, regularization strength, learning rate and number of layers are usually set outside the inner training loop. These are hyperparameters.

We choose them using validation evidence.

2. Grid search can waste experiments

If only 2 of 10 hyperparameters strongly matter, a dense grid spends most runs changing unimportant dimensions.

Random search samples combinations more broadly and often discovers strong regions faster in high-dimensional search spaces.

Bayesian/optimization methods can use results from earlier trials to choose promising later trials.

3. Search on useful scales

Learning rates such as 10−5,10−4,...,10−110^{-5},10^{-4},...,10^{-1} should often be explored on a logarithmic scale. Sampling uniformly from 0.00001 to 0.1 heavily concentrates trials near the large end.

4. The hidden overfitting problem

Run 10,000 experiments and choose the best validation score: you have adapted to the validation set. It is no longer fully independent evidence.

The final test set must remain untouched. In serious work, repeated validation and nested procedures may be needed.

5. Record the experiment

Every trial should store configuration, code/data version, seed and metrics. Otherwise hyperparameter search becomes irreproducible guesswork.

What to Remember

Hyperparameter tuning is itself a learning process and can overfit. Search deliberately, log everything, and protect the test set.

Next → Cross Validation: when data is scarce, can every example take a turn as validation evidence without contaminating training?

Six ways to work the chapter, climbing from explaining it in your own words to investigating it like a researcher. Reading is not enough — this is where the chapter lands.

  1. Explain: Parameter versus hyperparameter with examples.
  2. Calculate: Count trials in a 5×4×6 grid.
  3. Predict: Why is log-uniform sampling sensible for learning rate?
  4. Break: Tune repeatedly against one tiny validation set until validation/test diverge.
  5. Build: Implement random search with structured experiment logging.
  6. Investigate: Compare grid and random search under equal trial budgets.