Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
d1796934
Commit
d1796934
authored
Dec 09, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made test_layer() more robust.
parent
2ba29f65
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
core.h
dlib/dnn/core.h
+22
-3
No files found.
dlib/dnn/core.h
View file @
d1796934
...
@@ -1885,11 +1885,11 @@ namespace dlib
...
@@ -1885,11 +1885,11 @@ namespace dlib
template
<
template
<
typename
layer_details_type
typename
layer_details_type
>
>
layer_test_results
test_layer
(
layer_test_results
impl_test_layer
(
layer_details_type
l
layer_details_type
l
,
const
float
base_eps
)
)
{
{
const
float
base_eps
=
0
.
01
;
using
namespace
timpl
;
using
namespace
timpl
;
// Do some setup
// Do some setup
running_stats
<
double
>
rs_data
,
rs_params
;
running_stats
<
double
>
rs_data
,
rs_params
;
...
@@ -2080,6 +2080,25 @@ namespace dlib
...
@@ -2080,6 +2080,25 @@ namespace dlib
return
layer_test_results
();
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