Cross-Entropy Loss Curve Calculator

Explore cross-entropy behavior, compare training curves, inspect gradients, test weighting and smoothing, identify overfitting, and export clear results for practical model evaluation and learning.

Calculated results

Change inputs, then calculate.
Awaiting calculation

Interactive Plotly graph

Interpretation

No interpretation is available yet.

Formula used

L = -[y ln(p) + (1-y) ln(1-p)]

Selected-point details

Hover over chart points to inspect values.

Processed data

0 rows

Calculator settings

Loss inputs

Binary sample
Class weighting and curve range
Classes and vectors
Separate names with commas.
Categorical controls
Epoch and loss data
The first column is the epoch. Every additional numeric column becomes a model or split curve.
Batch CSV
Required columns: label and prediction. Optional columns: weight and model.
Shared numerical options

Graph options

Formula used

Binary cross-entropy

L = -[y ln(p) + (1-y) ln(1-p)]

Categorical cross-entropy

L = -Σ yᵢ ln(pᵢ)

Weighted cross-entropy

L = -Σ wᵢ yᵢ ln(pᵢ)

How to use

  1. Choose binary, categorical, training-history, or batch comparison mode.
  2. Enter probabilities or logits, labels, weights, smoothing, and clipping values.
  3. Select a graph view and adjust the visual display options.
  4. Press calculate to view losses, gradients, diagnostics, and processed rows.
  5. Export the table, chart, or complete report when finished.

Example data

ExampleActual targetPredictionExpected behavior
Correct high confidence10.95Very small loss
Correct low confidence10.55Moderate loss
Incorrect high confidence10.02Very large loss
Three-class exampleDog0.10, 0.78, 0.12Loss follows Dog probability
Overfitting historyValidation splitLoss rises after epoch sixEarly-stopping warning

Frequently asked questions

What does cross-entropy measure?

It measures disagreement between target labels and predicted probability distributions. Lower values usually indicate better probability predictions.

Why can cross-entropy become extremely large?

A confidently incorrect prediction assigns almost zero probability to the true outcome. The logarithm then creates a large penalty.

Why is probability clipping required?

Clipping prevents logarithms of zero and protects calculations from infinite or undefined values.

When should logits be used?

Use logits when predictions come directly from model outputs before sigmoid or softmax conversion.

What does label smoothing change?

It replaces perfectly hard targets with slightly distributed targets. This can reduce overconfidence and improve generalisation.

How do class weights affect loss?

Weights increase or decrease penalties for selected classes. They are useful with imbalanced datasets.

How is overfitting identified?

Training loss continues falling while validation loss stops improving or rises. The calculator estimates this gap and marks the best epoch.

What is the best loss value?

Zero is the theoretical minimum for perfect probability assignments. Practical values depend on class count, noise, and task difficulty.

Can several models be compared?

Yes. Training-history columns and batch model names create separate curves and model-level summaries.

Related Calculators

Cost Function CurveGradient Descent Path PlotContour Plot3D Loss SurfaceLearning-Rate Comparison PlotRegularisation CurveSigmoid Function GraphSoftmax Probability PlotEntropy CurveGini Impurity Curve

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.