code: def build_model(hp):
      """Constructs a model."""
      data_augmentation = tf.keras.Sequential(
          [
              tf.keras.layers.experimental.preprocessing.RandomFlip(),
              tf.keras.layers.experimental.preprocessing.RandomRotation(
                  0.1
              ),
              tf.keras.layers.experimental.preprocessing.RandomWidth(
                  0.1
              ),
              tf.keras.layers.experimental.preprocessing.RandomHeight(
                  0.1
              ),
          ]
      )
      inputs = tf.keras.Input(shape=(32, 32, 3))
      x = data_augmentation(inputs)
      x = tf.keras.layers.Conv2D(
          32,
          (3, 3),
          padding="same",
          activation=hp.Choice(
              "conv_activation_0",
              values=["relu", "elu"],
              default="relu",
          ),
      )(x)
  
      for i in range(hp.Int("num_blocks", 1, 3)):
          for j in range(hp.Int("num_conv_{}".format(str(i)), 1, 3)):
              x = tf.keras.layers.Conv2D(
                  hp.Int(
                      "filter_{}_{}".format(str(i), str(j)),
                      16,
                      256,
                      step=16,
                  ),
                  (3, 3),
                  padding="same",
                  activation=hp.Choice(
                      "conv_activation_{}_{}".format(str(i), str(j)),
                      values=["relu", "elu"],
                      default="relu",
                  ),
              )(x)
          x = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(x)
      x = tf.keras.layers.Dropout(
          rate=hp.Float(
              "dropout_1",
              min_value=0.0,
              max_value=0.9,
              default=0.25,
              step=0.05,
          )
      )(x)
      x = tf.keras.layers.GlobalMaxPooling2D()(x)
      x = tf.keras.layers.Dense(512, activation="relu")(x)
      outputs = tf.keras.layers.Dense(10, activation="softmax")(x)
      model = tf.keras.Model(inputs, outputs)
  
      lr_schedule = tf.keras.optimizers.schedules.ExponentialDecay(
          initial_learning_rate=hp.Choice(
              "initial_learning_rate", [1e-1, 1e-2, 1e-3]
          ),
          decay_steps=100000,
          decay_rate=hp.Choice("decay_rate", [0.5, 0.75, 0.95]),
          staircase=True,
      )
  
      model.compile(
          loss="sparse_categorical_crossentropy",
          optimizer=tf.keras.optimizers.RMSprop(
              learning_rate=lr_schedule
          ),
          metrics=["sparse_categorical_accuracy"],
      )
      return model
  
imports: import argparse
  import keras_tuner
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: build_model(hp) and returns: model