Function crossEntropy

Creates a cross entropy loss term suitable for multiclass classification problems.

Operation crossEntropy (
  Operation hypothesis,
  Operation groundTruth
);

It is assumed that the two input operations are rank-2 tensors, where the first dimension is an index into the batch, and the second index is the index into the label probabilities.

Parameters

NameDescription
hypothesis The predictions made by a model.
groundTruth The true values for the labels, as provided by the training dataset.

Returns

An Operation representing the mean cross entropy loss.