60 lines
2.8 KiB
TeX
60 lines
2.8 KiB
TeX
We instantiate the general ROLL framework (\Cref{sec:roll-formulation}) with Beta-distributed
|
|
scores. Beta ROLL applies when model scores are constrained to the open interval $(0,1)$,
|
|
as is the case when $f_\theta$ uses a sigmoid output activation. The Beta distribution is
|
|
supported on $(0,1)$ and its two shape parameters allow it to capture a wide range of
|
|
unimodal and skewed score distributions.
|
|
|
|
\paragraph{Forward pass.}
|
|
|
|
Given score vectors $\mathbf{s}^{(k)} \in (0,1)^{|\mathcal{B}_k|}$ for class $k$, let
|
|
$\mathbf{t}^{(k)} = \mathbf{1} - \mathbf{s}^{(k)}$ denote the complementary scores.
|
|
For any vector $\mathbf{v}$, write $\bar{v} = \frac{1}{|\mathbf{v}|}\sum_i v_i$.
|
|
We estimate the shape parameters using the closed-form log-moment estimator
|
|
of~\cite{chen2022beta}: define for each class $k$,
|
|
|
|
\begin{equation}
|
|
D_k = \overline{s^{(k)}\!\ln s^{(k)}} - \bar{s}^{(k)}\cdot\overline{\ln s^{(k)}}
|
|
+ \overline{t^{(k)}\!\ln t^{(k)}} - \bar{t}^{(k)}\cdot\overline{\ln t^{(k)}}
|
|
\label{eq:beta-denom}
|
|
\end{equation}
|
|
|
|
\begin{equation}
|
|
\hat{a}_k = \frac{\bar{s}^{(k)}}{D_k}, \qquad \hat{b}_k = \frac{\bar{t}^{(k)}}{D_k}
|
|
\label{eq:beta-params}
|
|
\end{equation}
|
|
|
|
These estimators follow from two simultaneous moment conditions:
|
|
$\mathbb{E}[X] = a/(a+b)$ and
|
|
$\operatorname{Cov}(X,\ln X) + \operatorname{Cov}(Y,\ln Y) = 1/(a+b)$,
|
|
where $Y=1-X\sim\operatorname{Beta}(b,a)$.
|
|
Replacing expectations by sample means and solving in closed form yields~\eqref{eq:beta-params}.
|
|
|
|
The CDF of $\operatorname{Beta}(\hat{a}_k,\hat{b}_k)$ at $x\in(0,1)$ is the
|
|
regularised incomplete beta function:
|
|
\begin{equation}
|
|
\hat{F}_k(x) = I_x(\hat{a}_k,\hat{b}_k)
|
|
= \frac{B(x;\,\hat{a}_k,\hat{b}_k)}{B(\hat{a}_k,\hat{b}_k)},
|
|
\qquad B(x;\,a,b) = \int_0^x u^{a-1}(1-u)^{b-1}\,\mathrm{d}u
|
|
\label{eq:beta-cdf}
|
|
\end{equation}
|
|
|
|
Substituting into the general ROLL objective \eqref{eq:roll-tpr-at-fpr}:
|
|
\begin{equation}
|
|
\mathcal{L}_{\text{ROLL-TPR@FPR}}^{\text{BETA}}(f_\theta(\mathcal{B});\,\alpha)
|
|
= I_{\hat\tau}(\hat{a}_1,\hat{b}_1),
|
|
\qquad
|
|
\hat\tau = I^{-1}_{1-\alpha}(\hat{a}_0,\hat{b}_0)
|
|
\label{eq:roll-tpr-at-fpr-beta}
|
|
\end{equation}
|
|
where $I^{-1}_{1-\alpha}(a,b)$ denotes the $(1-\alpha)$-quantile of $\operatorname{Beta}(a,b)$.
|
|
|
|
\paragraph{Gradient.}
|
|
|
|
Unlike the Gaussian case, we do not derive closed-form gradients for Beta ROLL.
|
|
The regularised incomplete beta function $I_x(a,b)$ and its inverse are smooth
|
|
functions of all their arguments and are available as differentiable operations in
|
|
PyTorch (\texttt{torch.special.betainc} and \texttt{torch.special.betaincinv}).
|
|
Gradients of \eqref{eq:roll-tpr-at-fpr-beta} with respect to $f_\theta(\mathbf{x}_i)$
|
|
are therefore propagated via automatic differentiation through the estimator
|
|
\eqref{eq:beta-params}, the CDF evaluation, and the quantile inversion.
|