Cross Entropy

Loss variant for multiclass classification. It interprets the model output as per-class logits and penalizes the negative log-probability of the correct class. Compatible with the multiclass policy.

Configuration

Selected as name: cross-entropy.

Option

Description

Type

Default

reduction

How per-sample losses are reduced.

mean | sum

mean

weight

Optional per-class weights for class imbalance.

list[float] | null

null

ignore_index

Target value that is ignored and contributes no gradient.

int

-100

label_smoothing

Amount of label smoothing in [0, 1].

float

0.0

components:
  loss:
    name: cross-entropy
    kwargs: {}