### Use epsilon (2^-52) instead of 1e-12

parent 6b81a67a
Pipeline #14126 failed with stages
in 15 minutes and 21 seconds
 ... @@ -123,9 +123,10 @@ double bob::measure::farThreshold(const blitz::Array &negatives, ... @@ -123,9 +123,10 @@ double bob::measure::farThreshold(const blitz::Array &negatives, blitz::Array scores; blitz::Array scores; sort(negatives, scores, is_sorted); sort(negatives, scores, is_sorted); double epsilon = std::numeric_limits::epsilon(); // handle special case of far == 1 without any iterating // handle special case of far == 1 without any iterating if (far_value >= 1 - 1e-12) if (far_value >= 1 - epsilon) return scores(0) - 1e-12; return scores(0) - epsilon; // Reverse negatives so the end is the start. This way the code below will be // Reverse negatives so the end is the start. This way the code below will be // very similar to the implementation in the frrThreshold function. The // very similar to the implementation in the frrThreshold function. The ... @@ -138,7 +139,7 @@ double bob::measure::farThreshold(const blitz::Array &negatives, ... @@ -138,7 +139,7 @@ double bob::measure::farThreshold(const blitz::Array &negatives, // since the comparison is `if score >= threshold then accept as genuine`, we // since the comparison is `if score >= threshold then accept as genuine`, we // can choose the largest score value + eps as the threshold so that we can // can choose the largest score value + eps as the threshold so that we can // get for 0% FAR. // get for 0% FAR. double valid_threshold = scores(current_position) + 1e-12; double valid_threshold = scores(current_position) + epsilon; double current_threshold; double current_threshold; double future_far; double future_far; while (current_position < total_count) { while (current_position < total_count) { ... @@ -177,9 +178,10 @@ double bob::measure::frrThreshold(const blitz::Array &negatives, ... @@ -177,9 +178,10 @@ double bob::measure::frrThreshold(const blitz::Array &negatives, blitz::Array scores; blitz::Array scores; sort(positives, scores, is_sorted); sort(positives, scores, is_sorted); double epsilon = std::numeric_limits::epsilon(); // handle special case of frr == 1 without any iterating // handle special case of frr == 1 without any iterating if (frr_value >= 1 - 1e-12) if (frr_value >= 1 - epsilon) return scores(scores.extent(0)-1) + 1e-12; return scores(scores.extent(0)-1) + epsilon; // Move towards the end of array changing the threshold until we pass the // Move towards the end of array changing the threshold until we pass the // desired FRR value. Starting with a threshold that corresponds to FRR == 0. // desired FRR value. Starting with a threshold that corresponds to FRR == 0. ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!