DERLoss#
- class torch_uncertainty.losses.DERLoss(reg_weight, reduction='mean')[source]#
The Deep Evidential Regression (DER) loss.
Combines the negative log-likelihood of a Normal-Inverse-Gamma (NIG) predictive distribution with a regulariser that penalises evidence on incorrect predictions:
\[\mathcal{L}(\boldsymbol{\theta}, y) = -\log p_\text{NIG}(y \mid \boldsymbol{\theta}) + \lambda \, |y - \mu| \, (2\lambda_\text{NIG} + \alpha),\]where \(\boldsymbol{\theta} = (\mu, \lambda_\text{NIG}, \alpha, \beta)\) are the NIG parameters predicted by the model and \(\lambda\) is
reg_weight. The regulariser shrinks the virtual observation count \(2\lambda_\text{NIG} + \alpha\) whenever the prediction is wrong, thereby increasing the predictive variance.- Parameters:
reg_weight (
float) – The weight \(\lambda\) of the regularization term.reduction (
str|None) – Specifies the reduction to apply to the output. Must be one of'none','mean'or'sum'.
References
[1] Amini, A., Schwarting, W., Soleimany, A., & Rus, D. (2020). Deep evidential regression. NeurIPS 2020.