L
Loss Function Explorer
Compare loss functions interactively. Drag predictions to see how MSE, cross-entropy, Huber, and more respond.
|
Click and drag to explore loss values
Controls
1.0
1.0
Properties
| Function | Sym. | Robust | Diff. | Type | Gradient |
|---|---|---|---|---|---|
| MSE | Yes | No | Yes | Reg | Linear (grows with error) |
| MAE | Yes | Yes | No | Reg | Constant (always +/-1) |
| Huber | Yes | Yes | Yes | Reg | Linear near 0, constant for large errors |
Formulas Reference
MSE: (y - ŷ)²
MAE: |y - ŷ|
Huber: ½a² if a≤δ, else δ(a-½δ)
BCE: -[y·log(p)+(1-y)·log(1-p)]
CCE: -y·log(p)
Hinge: max(0, 1-y·ŷ)
Focal: -α(1-p)ʸ·log(p)
Log-Cosh: log(cosh(y-ŷ))
Drag the vertical line or data points to explore. All computation runs entirely in your browser.