chola-coreloss
A smooth, tunable robust-regression loss function, founded by Gautam Ramesh. Built from two pieces chosen so both have gradients that saturate (bound) for large residuals -- the actual property that gives outlier robustness, not just "grows slower than x^2":
L(r) = ln(r^2 + 1) + huberized_power(r; p, delta)
ln(r^2 + 1)-- a Cauchy/Lorentzian-style term. Its gradient fades toward zero for large residuals.huberized_power(r; p, delta)-- behaves like|r|^pnear zero (curvature controlled byp) but continues as a straight line pastdelta, capping its gradient at a constant -- the same mechanism Huber loss uses, generalized to anyp.
Install
pip install chola-coreloss
Usage
import numpy as np
from chola_coreloss import chola_coreloss_grad, chola_coreloss_adaptive_grad
r = pred - target # residuals
# fixed delta (tune per-dataset via a validation set, like Huber's delta)
grad = chola_coreloss_grad(r, p=2.2, delta=0.7)
# recommended: adaptive delta, re-estimated from the residuals' own
# robust spread (MAD) -- no per-dataset retuning needed
grad = chola_coreloss_adaptive_grad(r, p=2.2, c=1.0)
Why adaptive delta
A fixed delta doesn't transfer between datasets -- it needs to track
the scale of your model's actual residuals, which differs per problem.
chola_coreloss_adaptive_grad re-estimates delta periodically from the
residuals' own robust spread (Median Absolute Deviation), the same
technique used in classical M-estimation / IRLS. Tested with c=1.0 on
real data (sklearn's diabetes dataset) and synthetic nonlinear data
(Friedman #1), clean and with injected label corruption, with no
per-dataset retuning:
- Matched or beat plain MSE on every clean-data run.
- Beat fixed-delta Huber loss by 5-7x (RMSE) on corrupted-label data.
Related work
This loss is in the same family as Barron's "A General and Adaptive Robust Loss Function" (CVPR 2019), which also combines a tunable shape parameter with an adaptive scale. chola-coreloss differs in its specific algebraic form (a sum of a Cauchy-style term and a Huberized power term, rather than one continuous interpolating expression) and in how the scale adapts (classical MAD-based re-estimation rather than a learned parameter). If you're citing or building on this work, read Barron's paper too.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chola_coreloss-0.2.0.tar.gz.
File metadata
- Download URL: chola_coreloss-0.2.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe4d4b16009de4ecce8e9d8c9a817c0b14caae89077d75a83793bb455ef2a8fb
|
|
| MD5 |
71628026f4f175a910ca771545a4fb0a
|
|
| BLAKE2b-256 |
f64dc870df066fca1a28dd426e648fb82c6787328f49a9d299821838142d8c0f
|
File details
Details for the file chola_coreloss-0.2.0-py3-none-any.whl.
File metadata
- Download URL: chola_coreloss-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66fcb2eebbf8ba6fd603a276ab9e174747432aba8befe8f9e9517a15f356bd34
|
|
| MD5 |
0ca519fba3938a534a3c55e4ecad4239
|
|
| BLAKE2b-256 |
d4fd1d64bd8ee83e778aeb3bc04f1886cf55c294278bae3718943fee1c5ea266
|