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
d1796934
Commit
d1796934
authored
Dec 08, 2015
by
Davis King
Browse files
Made test_layer() more robust.
parent
2ba29f65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
dlib/dnn/core.h
dlib/dnn/core.h
+22
-3
No files found.
dlib/dnn/core.h
View file @
d1796934
...
...
@@ -1885,11 +1885,11 @@ namespace dlib
template
<
typename
layer_details_type
>
layer_test_results
test_layer
(
layer_details_type
l
layer_test_results
impl_test_layer
(
layer_details_type
l
,
const
float
base_eps
)
{
const
float
base_eps
=
0.01
;
using
namespace
timpl
;
// Do some setup
running_stats
<
double
>
rs_data
,
rs_params
;
...
...
@@ -2080,6 +2080,25 @@ namespace dlib
return
layer_test_results
();
}
template
<
typename
layer_details_type
>
layer_test_results
test_layer
(
layer_details_type
l
)
{
// Try a few different derivative step sizes to see if any work.
for
(
float
base_eps
=
0.0001
;
base_eps
<
0.1
;
base_eps
*=
2
)
{
auto
result
=
impl_test_layer
(
l
,
base_eps
);
if
(
result
)
return
result
;
}
// However, if none of the step sizes worked then try this one and probably result
// in returning an error.
return
impl_test_layer
(
l
,
0.01
);
}
// ----------------------------------------------------------------------------------------
}
...
...
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