Skip to content

Main content

Multiclass Cross Entropy Smoothing Term Tool

Calculate multiclass cross entropy smoothing term from explicit caller-supplied inputs.

Loading tool…

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

  1. Enter probability, classes, trueClass, smoothing. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
probabilityProbabilityRequired. Finite number; maximum 1; strictly above 0.
classesClassesRequired. Safe integer; minimum 2.
trueClassTrue ClassRequired. Boolean.
smoothingSmoothingRequired. Finite number; minimum 0; maximum 1.
Output fieldInterpretationReturned shape
target(trueClass ? 1-smoothing : 0)+smoothing/classes; uniform mass includes the true class.Required. Finite number.
lossTermLoss TermRequired. Finite number.
json
{
  "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

  1. Calculation and input contract: classification/multiclass-cross-entropy-smoothing-term — tool.io

  2. Rethinking the Inception Architecture for Computer Vision — Christian Szegedy and coauthors

Similar or alternative tools