Description
Return one label-smoothed cross-entropy class term.
Training losses compare predicted probabilities with target mass, and temperature rescales logits before a probability transformation. Label smoothing and focal weighting alter particular loss terms; evaluating one term or transformation does not train a model, select its hyperparameters or establish calibrated confidence.
Return one label-smoothed cross-entropy class term.
When to use this tool
Use Multiclass Cross Entropy Smoothing Term when evaluating the stated loss contribution, smoothed target or temperature transformation.
How to use the tool and how it works
- Enter probability, classes, trueClass, smoothing. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read target, lossTerm. Use the output convention below.
Return one label-smoothed cross-entropy class term. Require probability in (0,1], classes >= 2 and smoothing in [0,1]; target = (trueClass ? 1-smoothing : 0)+smoothing/classes, lossTerm = -target*ln(probability).1
Uniform label smoothing mixes a one-hot target with equal mass over every class, including the true class.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| probability | Probability | Required. Finite number; maximum 1; strictly above 0. |
| classes | Classes | Required. Safe integer; minimum 2. |
| trueClass | True Class | Required. Boolean. |
| smoothing | Smoothing | Required. Finite number; minimum 0; maximum 1. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| target | (trueClass ? 1-smoothing : 0)+smoothing/classes; uniform mass includes the true class. | Required. Finite number. |
| lossTerm | Loss Term | Required. Finite number. |
{
"input": {
"probability": 0.5,
"classes": 4,
"trueClass": true,
"smoothing": 0.2
},
"output": {
"target": 0.8500000000000001,
"lossTerm": 0.5891751034759536
}
} Limitations and assumptions
- This is uniform-all-classes smoothing and one summand, not a full multiclass loss or model calibration.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Sum the appropriate contributions for a complete loss, and use a validated training/calibration procedure and held-out evaluation to select hyperparameters and assess predictions.
References
-
Calculation and input contract: classification/multiclass-cross-entropy-smoothing-term — tool.io
-
Rethinking the Inception Architecture for Computer Vision — Christian Szegedy and coauthors
Similar or alternative tools
- Classification: Binary Label Smoothing Target Pair
Return a uniformly smoothed binary target pair.
- Focal Loss One Probability Term
Return one focal-loss term for a true class.