Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.measure
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.measure
Commits
cb9cfbb7
There was a problem fetching the pipeline summary.
Commit
cb9cfbb7
authored
7 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
use C nexttoward
parent
1662e41e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!43
Resolve "FAR and FRR thresholds are computed even when there is no data support"
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/measure/cpp/error.cpp
+3
-3
3 additions, 3 deletions
bob/measure/cpp/error.cpp
with
3 additions
and
3 deletions
bob/measure/cpp/error.cpp
+
3
−
3
View file @
cb9cfbb7
...
@@ -126,7 +126,7 @@ double bob::measure::farThreshold(const blitz::Array<double, 1> &negatives,
...
@@ -126,7 +126,7 @@ double bob::measure::farThreshold(const blitz::Array<double, 1> &negatives,
double
epsilon
=
std
::
numeric_limits
<
double
>::
epsilon
();
double
epsilon
=
std
::
numeric_limits
<
double
>::
epsilon
();
// handle special case of far == 1 without any iterating
// handle special case of far == 1 without any iterating
if
(
far_value
>=
1
-
epsilon
)
if
(
far_value
>=
1
-
epsilon
)
return
std
::
nexttoward
(
scores
(
0
),
scores
(
0
)
-
1
);
return
nexttoward
(
scores
(
0
),
scores
(
0
)
-
1
);
// 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
...
@@ -139,7 +139,7 @@ double bob::measure::farThreshold(const blitz::Array<double, 1> &negatives,
...
@@ -139,7 +139,7 @@ double bob::measure::farThreshold(const blitz::Array<double, 1> &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
=
std
::
nexttoward
(
scores
(
current_position
),
scores
(
current_position
)
+
1
);
double
valid_threshold
=
nexttoward
(
scores
(
current_position
),
scores
(
current_position
)
+
1
);
double
current_threshold
;
double
current_threshold
;
double
future_far
;
double
future_far
;
while
(
current_position
<
total_count
)
{
while
(
current_position
<
total_count
)
{
...
@@ -181,7 +181,7 @@ double bob::measure::frrThreshold(const blitz::Array<double, 1> &negatives,
...
@@ -181,7 +181,7 @@ double bob::measure::frrThreshold(const blitz::Array<double, 1> &negatives,
double
epsilon
=
std
::
numeric_limits
<
double
>::
epsilon
();
double
epsilon
=
std
::
numeric_limits
<
double
>::
epsilon
();
// handle special case of frr == 1 without any iterating
// handle special case of frr == 1 without any iterating
if
(
frr_value
>=
1
-
epsilon
)
if
(
frr_value
>=
1
-
epsilon
)
return
std
::
nexttoward
(
scores
(
scores
.
extent
(
0
)
-
1
),
scores
(
scores
.
extent
(
0
)
-
1
)
+
1
);
return
nexttoward
(
scores
(
scores
.
extent
(
0
)
-
1
),
scores
(
scores
.
extent
(
0
)
-
1
)
+
1
);
// 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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment