class_docstr: Base class for the heads, e.g. classification, regression.
  
  # Arguments
      loss: A Keras loss function. Defaults to None. If None, the loss will be
          inferred from the AutoModel.
      metrics: A list of Keras metrics. Defaults to None. If None, the metrics
          will be inferred from the AutoModel.
code: def __init__(
      self,
      loss: Optional[types.LossType] = None,
      metrics: Optional[types.MetricsType] = None,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self.loss = loss
      if metrics is None:
          metrics = []
      self.metrics = metrics
  
file_path: autokeras/autokeras/engine/head.py
imports: from typing import Optional
  from tensorflow import keras
  from autokeras.engine import io_hypermodel
  from autokeras.utils import types
label_desc: Use image node_id 1 to create a new Head object from inherited base classes: io_hypermodel with example: obj = Head(loss, metrics)