Head

[source]

ClassificationHead

autokeras.hypermodel.head.ClassificationHead(num_classes=None, multi_label=False, loss=None, metrics=None, dropout_rate=None)

Classification Dense layers.

Use sigmoid and binary crossentropy for binary classification and multi-label classification. Use softmax and categorical crossentropy for multi-class (more than 2) classification. Use Accuracy as metrics by default.

Arguments

  • num_classes: Int. Defaults to None. If None, it will infer from the data.
  • multi_label: Boolean. Defaults to False.
  • 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.
  • dropout_rate: Float. The dropout rate for the layers. If left unspecified, it will be tuned automatically.

[source]

RegressionHead

autokeras.hypermodel.head.RegressionHead(output_dim=None, loss=None, metrics=None, dropout_rate=None)

Regression Dense layers.

Use mean squared error as metrics and loss by default.

Arguments

  • output_dim: Int. The number of output dimensions. Defaults to None. If None, it will infer from the data.
  • multi_label: Boolean. Defaults to False.
  • 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.
  • dropout_rate: Float. The dropout rate for the layers. If left unspecified, it will be tuned automatically.