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
20378b08
"git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "e83d417721548902298f3a45b446924883d2e009"
Commit
20378b08
authored
Dec 18, 2020
by
Davis King
Browse files
make test run faster
parent
0fede57e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
dlib/test/rand.cpp
dlib/test/rand.cpp
+11
-14
No files found.
dlib/test/rand.cpp
View file @
20378b08
...
@@ -432,21 +432,18 @@ namespace
...
@@ -432,21 +432,18 @@ namespace
print_spinner
();
print_spinner
();
dlib
::
rand
rnd
(
0
);
dlib
::
rand
rnd
(
0
);
const
size_t
N
=
1024
*
1024
*
128
;
const
size_t
N
=
1024
*
1024
*
5
;
const
double
tol
=
0.01
;
for
(
double
lambda
=
6
;
lambda
<
20
;
lambda
+=
0.1
)
const
double
lambda
=
1.5
;
{
print_spinner
();
print_spinner
();
dlib
::
running_stats
<
double
>
stats
;
dlib
::
running_stats
<
double
>
stats
;
for
(
size_t
i
=
0
;
i
<
N
;
i
++
)
for
(
size_t
i
=
0
;
i
<
N
;
i
++
)
stats
.
add
(
rnd
.
get_random_exponential
(
lambda
));
stats
.
add
(
rnd
.
get_random_exponential
(
lambda
));
DLIB_TEST
(
std
::
abs
(
stats
.
mean
()
-
1.0
/
lambda
)
<
0.001
);
DLIB_TEST
(
std
::
abs
(
stats
.
mean
()
-
1.0
/
lambda
)
<
tol
);
DLIB_TEST
(
std
::
abs
(
stats
.
variance
()
-
1.0
/
(
lambda
*
lambda
))
<
0.001
);
DLIB_TEST
(
std
::
abs
(
stats
.
variance
()
-
1.0
/
(
lambda
*
lambda
))
<
tol
);
DLIB_TEST
(
std
::
abs
(
stats
.
skewness
()
-
2.0
)
<
0.01
);
DLIB_TEST
(
std
::
abs
(
stats
.
skewness
()
-
2.0
)
<
tol
);
DLIB_TEST
(
std
::
abs
(
stats
.
ex_kurtosis
()
-
6.0
)
<
0.1
);
DLIB_TEST
(
std
::
abs
(
stats
.
ex_kurtosis
()
-
6.0
)
<
0.1
);
}
}
}
class
rand_tester
:
public
tester
class
rand_tester
:
public
tester
...
...
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