How to use this calculator
Evaluate one multiclass prediction with optional uniform label smoothing.
- Enter Predicted nonnegative class weights, Correct class index (one based), Label smoothing fraction. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Multiclass cross entropy with label smoothing explained
Multiclass cross entropy scores the probability assigned to the correct class. Uniform label smoothing spreads some target weight across every class, so zero smoothing is ordinary one-hot cross entropy; predicted weights are normalized before logarithms are taken.
Inputs, symbols, and units
p— Predicted nonnegative class weights- Predicted nonnegative class weights. Use comma-separated values in the stated order.
y— Correct class index (one based)- Correct class index (one based). Enter a whole number.
e— Label smoothing fraction- Label smoothing fraction.
Formula and method
Negative smoothed target log probability
Symbols use the input definitions below. Predicted weights are normalized; all probabilities must be positive for this finite-log implementation.
A worked scenario
Predicted nonnegative class weights = 0.1, 0.7, 0.2; Correct class index (one based) = 2; Label smoothing fraction = 0.
- Multiclass cross entropy: 0.35667494 nats
This scenario uses the stated units and assumptions. Displayed values are rounded only after calculation.
Assumptions and edge cases
Predicted weights are normalized; all probabilities must be positive for this finite-log implementation. Smoothing mixes the one-hot label with a uniform target.
Frequently asked questions
Which class index should I enter?
Indices begin at one in the displayed order.
Is this batch average loss?
No, it is the loss for one example.
Does smoothing change the prediction?
It changes the target used in the loss.
How do I use the Multiclass cross entropy with label smoothing calculator?
Enter Predicted nonnegative class weights, Correct class index (one based), Label smoothing fraction. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Multiclass cross entropy with label smoothing?
Predicted nonnegative class weights = 0.1, 0.7, 0.2; Correct class index (one based) = 2; Label smoothing fraction = 0. Multiclass cross entropy: 0.35667494 nats This scenario uses the stated units and assumptions. Displayed values are rounded only after calculation.
Read our calculation methodology.