-
Book Overview & Buying
-
Table Of Contents
Hands-On Artificial Intelligence for IoT - Second Edition
By :
Hyperparameter tuning is a critical step in optimizing the performance of our deep learning models. Unlike model parameters—which are learned during training—hyperparameters (such as the number of filters in a convolutional layer, the learning rate, or the dropout rate) must be set before training. In a previous chapter, we saw how scikit-learn’s GridSearchCV can be used to search over hyperparameters for conventional ML models. In this section, we will leverage Keras Tuner to automatically search for the best hyperparameters for a CNN using Keras 3. You will need to install Keras Tuner for this:
pip install keras_tuner
Keras Tuner provides a high-level API that integrates directly with your Keras models and supports various search algorithms (e.g., Random Search, Hyperband, and Bayesian Optimization). This allows us to efficiently explore different configurations and find the optimal settings for our model.
Keras...