Understanding the syntax and use of Keras Tuner
For the most part, as far as Keras Tuner is concerned, hyperparameters can be described by the following three data types: integers, floating points, and choices from a list of discrete values or objects. In the following sub-sections, we will take a closer look at how to use these data types to define hyperparameters in different parts of the model architecture and training workflow.
Using hp.Int for hyperparameter definition
Keras Tuner defines a search space with a very simple and intuitive style. To define a set of possible number of nodes in a given layer, you typically would have a layer definition like the this:
tf.keras.layers.Dense(units = hp_units, activation = 'relu')
In the preceding line of code, hp_units
is the number of nodes in this layer. If you wish to subject hp_units
to hyperparameter search, then you simply need to define the definition for this hyperparameter's search space. Here&apos...