liveBook · Manning

Optuna

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

Optuna is an open-source Python library for automated hyperparameter optimization with trial pruning, parallel execution, and visualization.

Optuna automates hyperparameter searches for model training. It helps replace impractical manual tuning with repeatable trials that can improve model quality while controlling training time and memory use. section 5.0 section 5.4.2

Use Optuna as a lightweight Python library when models run on local machines or small managed clusters. It supports large search spaces, early pruning of unpromising trials, parallel execution, and interactive visualization of parameter interactions. section 5.4 section 5.4.2

A typical Optuna workflow has three responsibilities:

  • Define an objective function that receives trial hyperparameters, trains a model, evaluates it, and returns a numeric score. section 5.4
  • Create a study representing the optimization process and configure a maximum trial quota. section 5.4.2
  • Generate values with trial.suggest_xxx calls, then share persistent study storage when running trials across processes or machines. section 5.4.2

Scikit-learn model selection

An objective function can choose between SVR and RandomForest, sample model-specific parameters such as SVR regularization or tree depth, train on a split dataset, and return mean squared error.

Figure 5.11 An objective function receives the hyperparameters as input and returns a score.

Trace how an objective function converts suggested hyperparameters into a training result and score. section 5.4

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

How deep it goes
Explains objective functions, studies, suggestions, pruning, and parallel setup, but remains an overview rather than search-algorithm internals.
Examples
Uses scikit-learn SVR and RandomForest regressors, sampled parameters, dataset splitting, and mean squared error.
What it assumes
Assumes model-training and evaluation code, while explaining objective functions and requiring no deep understanding of learning algorithms.
What you can do after
Apply via Optuna by defining an objective, creating a study, setting a trial quota, and optionally sharing relational storage.
How it connects
Connects objective functions, model training, evaluation, Bayesian search, pruning, parallel execution, and visualization.

Also explained in

Compare how 3 books explain Optuna →

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.