class_docstr: A graph consists of connected Blocks, or Heads.
  
  # Arguments
      inputs: A list of input node(s) for the Graph.
      outputs: A list of output node(s) for the Graph.
code: def _compile_keras_model(self, hp, model):
      # Specify hyperparameters from compile(...)
      optimizer_name = hp.Choice(
          "optimizer",
          ["adam", "sgd", "adam_weight_decay"],
          default="adam",
      )
      # TODO: add adadelta optimizer when it can optimize embedding layer on
      # GPU.
      learning_rate = hp.Choice(
          "learning_rate",
          [1e-1, 1e-2, 1e-3, 1e-4, 2e-5, 1e-5],
          default=1e-3,
      )
  
      if optimizer_name == "adam":
          optimizer = keras.optimizers.Adam(learning_rate=learning_rate)
      elif optimizer_name == "sgd":
          optimizer = keras.optimizers.SGD(learning_rate=learning_rate)
      elif optimizer_name == "adam_weight_decay":
          steps_per_epoch = int(self.num_samples / self.batch_size)
          num_train_steps = steps_per_epoch * self.epochs
          warmup_steps = int(
              self.epochs * self.num_samples * 0.1 / self.batch_size
          )
  
          lr_schedule = keras.optimizers.schedules.PolynomialDecay(
              initial_learning_rate=learning_rate,
              decay_steps=num_train_steps,
              end_learning_rate=0.0,
          )
          if warmup_steps:
              lr_schedule = keras_layers.WarmUp(
                  initial_learning_rate=learning_rate,
                  decay_schedule_fn=lr_schedule,
                  warmup_steps=warmup_steps,
              )
  
          optimizer = keras.optimizers.experimental.AdamW(
              learning_rate=lr_schedule,
              weight_decay=0.01,
              beta_1=0.9,
              beta_2=0.999,
              epsilon=1e-6,
          )
  
      model.compile(
          optimizer=optimizer,
          metrics=self._get_metrics(),
          loss=self._get_loss(),
      )
  
      return model
  
imports: import keras_tuner
  from tensorflow import keras
  from tensorflow import nest
  from autokeras import blocks
  from autokeras import keras_layers
  from autokeras import nodes
  from autokeras.engine import head
  from autokeras.engine import serializable
  from autokeras.utils import io_utils
label_desc: Use image node_id 12 for calling the Graph obj's underlying member method code with example usage: obj._compile_keras_model(hp, model) and returns: model