class_docstr: An EfficientNet hypermodel.
  
  Models built by `HyperEfficientNet` take images with shape (height, width,
  channels) as input. The output are one-hot encoded with the length matching
  the number of classes specified by the `classes` argument.
  
  Args:
      input_shape: Optional shape tuple, e.g. `(256, 256, 3)`.  One of
          `input_shape` or `input_tensor` must be specified.
      input_tensor: Optional Keras tensor (i.e. output of `layers.Input()`)
          to use as image input for the model.  One of `input_shape` or
          `input_tensor` must be specified.
      classes: Optional number of classes to classify images into, only to be
          specified if `include_top` is True, and if no `weights` argument is
          specified.
      augmentation_model: Optional `Model` or `HyperModel` instance for image
          augmentation.
      **kwargs: Additional keyword arguments that apply to all hypermodels.
          See `keras_tuner.HyperModel`.
code: def build(self, hp):
      if self.input_tensor is not None:
          inputs = keras.utils.get_source_inputs(self.input_tensor)
          x = self.input_tensor
      else:
          inputs = layers.Input(shape=self.input_shape)
          x = inputs
  
      if self.augmentation_model:
          if isinstance(self.augmentation_model, hypermodel.HyperModel):
              augmentation_model = self.augmentation_model.build(hp)
          elif isinstance(self.augmentation_model, keras.models.Model):
              augmentation_model = self.augmentation_model
  
          x = augmentation_model(x)
  
      # Select one of pre-trained EfficientNet as feature extractor
      version = hp.Choice(
          "version", [f"B{i}" for i in range(8)], default="B0"
      )
      img_size = EFFICIENTNET_IMG_SIZE[version]
  
      x = layers.Resizing(img_size, img_size, interpolation="bilinear")(
          x
      )
      efficientnet_model = EFFICIENTNET_MODELS[version](
          include_top=False, input_tensor=x
      )
  
      # Rebuild top layers of the model.
      x = efficientnet_model.output
  
      pooling = hp.Choice("pooling", ["avg", "max"], default="avg")
      if pooling == "avg":
          x = layers.GlobalAveragePooling2D(name="avg_pool")(x)
      elif pooling == "max":
          x = layers.GlobalMaxPooling2D(name="max_pool")(x)
  
      top_dropout_rate = hp.Float(
          "top_dropout_rate",
          min_value=0.2,
          max_value=0.8,
          step=0.2,
          default=0.2,
      )
      x = layers.Dropout(top_dropout_rate, name="top_dropout")(x)
  
      x = layers.Dense(
          self.classes, activation="softmax", name="probs"
      )(x)
  
      # compile
      model = keras.Model(inputs, x, name="EfficientNet")
      self._compile(model, hp)
  
      return model
  
file_path: keras-tuner/keras_tuner/applications/efficientnet.py
imports: from keras_tuner.api_export import keras_tuner_export
  from keras_tuner.backend import keras
  from keras_tuner.backend.keras import layers
  from keras_tuner.engine import hypermodel
label_desc: Use image node_id 2 for calling the HyperEfficientNet obj's underlying member method code with example usage: obj.build(hp) and returns: model