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
4aa0e3be
Commit
4aa0e3be
authored
Dec 12, 2015
by
Davis King
Browse files
updated tests
parent
ee6e54b4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
dlib/test/dnn.cpp
dlib/test/dnn.cpp
+16
-6
No files found.
dlib/test/dnn.cpp
View file @
4aa0e3be
...
...
@@ -417,8 +417,8 @@ namespace
{
resizable_tensor
A
,
B
;
A
.
set_size
(
2
,
3
);
B
.
set_size
(
2
,
3
);
A
.
set_size
(
2
,
3
,
4
,
5
);
B
.
set_size
(
2
,
3
,
4
,
5
);
tensor_rand
rnd
;
rnd
.
fill_uniform
(
A
);
...
...
@@ -451,19 +451,29 @@ namespace
DLIB_TEST
(
max
(
abs
(
mat
(
A
)
-
truth
))
<
1e-6
);
B
.
set_size
(
1
,
3
);
B
.
set_size
(
1
,
3
,
4
,
5
);
rnd
.
fill_uniform
(
A
);
rnd
.
fill_uniform
(
B
);
truth
=
2
*
mat
(
A
)
+
3
*
join_cols
(
mat
(
B
),
mat
(
B
));
tt
::
add
(
2
,
A
,
3
,
B
);
DLIB_TEST
(
max
(
abs
(
mat
(
A
)
-
truth
))
<
1e-6
);
DLIB_TEST
(
A
.
num_samples
()
==
2
);
B
.
set_size
(
2
,
1
);
B
.
set_size
(
1
,
1
,
4
,
5
);
rnd
.
fill_uniform
(
A
);
rnd
.
fill_uniform
(
B
);
truth
=
2
*
mat
(
A
)
+
3
*
join_rows
(
mat
(
B
),
join_rows
(
mat
(
B
),
mat
(
B
)));
matrix
<
float
>
temp
=
join_rows
(
mat
(
B
),
join_rows
(
mat
(
B
),
mat
(
B
)));
truth
=
2
*
mat
(
A
)
+
3
*
join_cols
(
temp
,
temp
);
tt
::
add
(
2
,
A
,
3
,
B
);
DLIB_TEST
(
max
(
abs
(
mat
(
A
)
-
truth
))
<
1e-6
);
DLIB_TEST_MSG
(
max
(
abs
(
mat
(
A
)
-
truth
))
<
1e-6
,
max
(
abs
(
mat
(
A
)
-
truth
)));
B
.
set_size
(
1
,
3
,
1
,
1
);
rnd
.
fill_uniform
(
A
);
rnd
.
fill_uniform
(
B
);
resizable_tensor
AA
(
A
),
BB
(
B
);
tt
::
add
(
2
,
A
,
3
,
B
);
cpu
::
add
(
2
,
AA
,
3
,
BB
);
DLIB_TEST_MSG
(
max
(
abs
(
mat
(
A
)
-
mat
(
AA
)
))
<
1e-6
,
max
(
abs
(
mat
(
A
)
-
mat
(
AA
)
)));
}
}
...
...
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