public interface ClassificationLoss<T extends AbstractFloat = Float> extends SupervisedLoss<T, Int>
Mean classification loss with integer target labels. compute(logits, labels, gradientScale) returns a mean loss and its mean-reduced output derivative, without input mutation. Logits have shape [samples, classes], labels [samples]; the positive finite gradientScale multiplies only the derivative and defaults to one.
loss as ClassificationLoss<Float> = SparseCategoricalCrossentropy<Float>()