> "The smooth operator that acts like L2 for small errors and L1 for large ones."
Log-Cosh Loss combines the best properties of L1 (absolute) and L2 (squared) error metrics through the logarithm of the hyperbolic cosine function. It provides smooth gradients everywhere while remaining robust to outliers.
## Historical Context
Log-Cosh emerged from the machine learning community as a loss function for neural network training. Its smooth, differentiable nature makes it ideal for gradient-based optimization, while its asymptotic L1 behavior provides robustness similar to absolute error. It has since been adopted as a general-purpose error metric.
## Architecture & Physics
The function `log(cosh(x))` has remarkable properties: for small x, it approximates `x²/2` (L2 behavior), while for large x, it approximates `|x| - log(2)` (L1 behavior). This creates a smooth transition between squared and absolute error regimes.
For large errors, Log-Cosh grows approximately linearly (like L1), avoiding the explosion of L2 with outliers. For small errors, it provides the smooth quadratic behavior of L2.
## Common Use Cases
1.**Machine Learning**: Differentiable loss function for training
2.**Robust Regression**: When outliers exist but smooth gradients needed
3.**Financial Modeling**: Price prediction with occasional spikes
4.**Hybrid Metrics**: Combining L1 and L2 benefits