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
1154cf73
Commit
1154cf73
authored
Jun 20, 2011
by
Davis King
Browse files
Fixed a bug in the svm_struct test. The test would always fail if run
more than once.
parent
d1c0e27d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
dlib/test/svm_struct.cpp
dlib/test/svm_struct.cpp
+7
-5
No files found.
dlib/test/svm_struct.cpp
View file @
1154cf73
...
...
@@ -487,12 +487,12 @@ namespace
void
make_dataset
(
std
::
vector
<
sample_type
>&
samples
,
std
::
vector
<
scalar_type
>&
labels
,
int
num
int
num
,
dlib
::
rand
&
rnd
)
{
samples
.
clear
();
labels
.
clear
();
static
dlib
::
rand
rnd
;
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
for
(
int
j
=
0
;
j
<
num
;
++
j
)
...
...
@@ -618,16 +618,18 @@ namespace
std
::
vector
<
sample_type
>
samples
;
std
::
vector
<
scalar_type
>
labels
;
dlib
::
rand
rnd
;
dlog
<<
LINFO
<<
"test with 100 samples per class"
;
make_dataset
(
samples
,
labels
,
100
);
make_dataset
(
samples
,
labels
,
100
,
rnd
);
run_test
(
samples
,
labels
,
1.155
);
dlog
<<
LINFO
<<
"test with 1 sample per class"
;
make_dataset
(
samples
,
labels
,
1
);
make_dataset
(
samples
,
labels
,
1
,
rnd
);
run_test
(
samples
,
labels
,
0.251
);
dlog
<<
LINFO
<<
"test with 2 sample per class"
;
make_dataset
(
samples
,
labels
,
2
);
make_dataset
(
samples
,
labels
,
2
,
rnd
);
run_test
(
samples
,
labels
,
0.444
);
}
}
a
;
...
...
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