deephyper.ensemble.loss.CategoricalCrossEntropy

deephyper.ensemble.loss.CategoricalCrossEntropy#

class deephyper.ensemble.loss.CategoricalCrossEntropy[source]#

Bases: Loss

Categorical-Cross Entropy (a.k.a., Log-Loss) function for classification.

  • y_true is an array of integers representing the true class labels.

  • y_pred is an array of predicted categorical probabilities.

Methods

__call__(y_true: ndarray, y_pred: ndarray | dict) ndarray[source]#

Compute the loss function.

Parameters:
  • y_true (np.ndarray) – the true target values.

  • y_pred (np.ndarray or dict) – the predicted target values.

Returns:

the loss value with first dimension n_samples.

Return type:

np.ndarray