diff --git a/metrics/auroc.py b/metrics/auroc.py index 6e0418f..d04e27d 100644 --- a/metrics/auroc.py +++ b/metrics/auroc.py @@ -160,5 +160,5 @@ class AUROCWithMWU(torchmetrics.Metric): # Compute auroc with the weight set to 1/2 when positive & negative have identical scores. auroc = auroc_le - (auroc_le - auroc_lt) / 2.0 - - return auroc \ No newline at end of file + return auroc + \ No newline at end of file diff --git a/metrics/rce.py b/metrics/rce.py index 5d1e092..be5dfa4 100644 --- a/metrics/rce.py +++ b/metrics/rce.py @@ -21,7 +21,8 @@ def _smooth( label_smoothing: smoothing constant. Returns: Smoothed values. """ - return value * (1.0 - label_smoothing) + 0.5 * label_smoothing + smoothed_values = value * (1.0 - label_smoothing) + 0.5 * label_smoothing + return smoothed_values def _binary_cross_entropy_with_clipping( @@ -179,7 +180,6 @@ class RCE(torchmetrics.Metric): pred_ce = self.binary_cross_entropy.compute() rce = (1.0 - (pred_ce / baseline_ce)) * 100 - return rce def reset(self):