Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
835e0bd8
Commit
835e0bd8
authored
May 02, 2013
by
Davis King
Browse files
Changed test_ranking_function() and cross_validate_ranking_trainer() slightly
to avoid a run time error in gcc 4.7.
parent
967cd822
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
dlib/svm/ranking_tools.h
dlib/svm/ranking_tools.h
+1
-1
dlib/test/ranking.cpp
dlib/test/ranking.cpp
+4
-0
No files found.
dlib/svm/ranking_tools.h
View file @
835e0bd8
...
@@ -227,7 +227,7 @@ namespace dlib
...
@@ -227,7 +227,7 @@ namespace dlib
return
true
;
return
true
;
else
if
(
a
.
first
>
b
.
first
)
else
if
(
a
.
first
>
b
.
first
)
return
false
;
return
false
;
else
if
(
a
.
second
==
true
)
else
if
(
a
.
second
&&
!
b
.
second
)
return
true
;
return
true
;
else
else
return
false
;
return
false
;
...
...
dlib/test/ranking.cpp
View file @
835e0bd8
...
@@ -144,6 +144,10 @@ namespace
...
@@ -144,6 +144,10 @@ namespace
samples
.
push_back
(
p
);
samples
.
push_back
(
p
);
dlog
<<
LINFO
<<
"cv-accuracy: "
<<
cross_validate_ranking_trainer
(
trainer
,
samples
,
4
);
dlog
<<
LINFO
<<
"cv-accuracy: "
<<
cross_validate_ranking_trainer
(
trainer
,
samples
,
4
);
DLIB_TEST
(
equal
(
cross_validate_ranking_trainer
(
trainer
,
samples
,
4
)
,
res
));
DLIB_TEST
(
equal
(
cross_validate_ranking_trainer
(
trainer
,
samples
,
4
)
,
res
));
df
.
basis_vectors
(
0
)
=
0
;
dlog
<<
LINFO
<<
"BAD RANKING:"
<<
test_ranking_function
(
df
,
samples
);
DLIB_TEST
(
test_ranking_function
(
df
,
samples
)(
1
)
<
0.5
);
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment