Implementing Sequential Model Algorithm Configuration
Sequential Model Algorithm Configuration (SMAC) is one of the variants of the Bayesian Optimization hyperparameter tuning group (see Chapter 4) that the NNI package can implement. Note that to use SMAC in NNI, we need to install additional dependencies using the following command: pip install "nni[SMAC]"
. Let’s use the same data, pipeline, and hyperparameter space as in the example in the previous section to implement SMAC with NNI using pure Python code.
The following code shows how to implement SMAC with the NNI package using pure Python code. You can find the more detailed code in the GitHub repository mentioned in the Technical requirements section:
- Prepare the model to be tuned in a script. We’ll use the same
model.py
script as in the previous section. - Define the hyperparameter space in the form of a Python dictionary. We’ll use the same hyperparameter space as in the previous section...