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
a746eb1e
Commit
a746eb1e
authored
Sep 25, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More cleanup
parent
446bd3c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
56 deletions
+60
-56
core.h
dlib/dnn/core.h
+2
-0
core_abstract.h
dlib/dnn/core_abstract.h
+58
-56
No files found.
dlib/dnn/core.h
View file @
a746eb1e
...
@@ -321,6 +321,8 @@ namespace dlib
...
@@ -321,6 +321,8 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// This version of add_layer handles the special case where the sub network being given is
// just an input layer object.
template
<
typename
LAYER_DETAILS
,
typename
INPUT_LAYER
,
typename
enabled
>
template
<
typename
LAYER_DETAILS
,
typename
INPUT_LAYER
,
typename
enabled
>
class
add_layer
class
add_layer
{
{
...
...
dlib/dnn/core_abstract.h
View file @
a746eb1e
...
@@ -135,7 +135,7 @@ namespace dlib
...
@@ -135,7 +135,7 @@ namespace dlib
REQUIREMENTS ON SUB_NET
REQUIREMENTS ON SUB_NET
- One of the following must be true:
- One of the following must be true:
- SUB_NET implements the
input interface (TODO clarify)
defined in
- SUB_NET implements the
EXAMPLE_INPUT interface
defined in
input_abstract.h.
input_abstract.h.
- SUB_NET is an add_layer object.
- SUB_NET is an add_layer object.
- SUB_NET is an add_tag_layer object.
- SUB_NET is an add_tag_layer object.
...
@@ -523,6 +523,63 @@ namespace dlib
...
@@ -523,6 +523,63 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
unsigned
long
ID
,
typename
SUB_NET
>
class
add_tag_layer
{
/*!
REQUIREMENTS ON SUB_NET
WHAT THIS OBJECT REPRESENTS
This object draws its inputs from sub_net() and performs the identity
transform. This means it is a no-op and its presence does not change
the behavior of the network. It exists solely to be used by add_skip_layer
to reference a particular part of a network.
!*/
};
template
<
typename
SUB_NET
>
using
tag1
=
add_tag_layer
<
1
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag2
=
add_tag_layer
<
2
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag3
=
add_tag_layer
<
3
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag4
=
add_tag_layer
<
4
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag5
=
add_tag_layer
<
5
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag6
=
add_tag_layer
<
6
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag7
=
add_tag_layer
<
7
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag8
=
add_tag_layer
<
8
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag9
=
add_tag_layer
<
9
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag10
=
add_tag_layer
<
10
,
SUB_NET
>
;
// ----------------------------------------------------------------------------------------
template
<
template
<
typename
>
class
TAG_TYPE
,
typename
SUB_NET
>
class
add_skip_layer
{
/*!
WHAT THIS OBJECT REPRESENTS
This object draws its inputs from layer<TAG_TYPE>(sub_net())
and performs the identity transform.
!*/
};
template
<
typename
SUB_NET
>
using
skip1
=
add_skip_layer
<
tag1
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip2
=
add_skip_layer
<
tag2
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip3
=
add_skip_layer
<
tag3
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip4
=
add_skip_layer
<
tag4
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip5
=
add_skip_layer
<
tag5
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip6
=
add_skip_layer
<
tag6
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip7
=
add_skip_layer
<
tag7
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip8
=
add_skip_layer
<
tag8
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip9
=
add_skip_layer
<
tag9
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip10
=
add_skip_layer
<
tag10
,
SUB_NET
>
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
template
<
...
@@ -581,61 +638,6 @@ namespace dlib
...
@@ -581,61 +638,6 @@ namespace dlib
- returns layer<i>(layer<Match>(n))
- returns layer<i>(layer<Match>(n))
!*/
!*/
// ----------------------------------------------------------------------------------------
template
<
unsigned
long
ID
,
typename
SUB_NET
>
class
add_tag_layer
{
/*!
WHAT THIS OBJECT REPRESENTS
This object draws its inputs from sub_net() and performs the identity
transform. This means it is a no-op and its presence does not change
the behavior of the network. It exists solely to be used by add_skip_layer
to reference a particular part of a network.
!*/
};
template
<
typename
SUB_NET
>
using
tag1
=
add_tag_layer
<
1
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag2
=
add_tag_layer
<
2
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag3
=
add_tag_layer
<
3
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag4
=
add_tag_layer
<
4
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag5
=
add_tag_layer
<
5
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag6
=
add_tag_layer
<
6
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag7
=
add_tag_layer
<
7
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag8
=
add_tag_layer
<
8
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag9
=
add_tag_layer
<
9
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag10
=
add_tag_layer
<
10
,
SUB_NET
>
;
// ----------------------------------------------------------------------------------------
template
<
template
<
typename
>
class
TAG_TYPE
,
typename
SUB_NET
>
class
add_skip_layer
{
/*!
WHAT THIS OBJECT REPRESENTS
This object draws its inputs from layer<TAG_TYPE>(sub_net())
and performs the identity transform.
!*/
};
template
<
typename
SUB_NET
>
using
skip1
=
add_skip_layer
<
tag1
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip2
=
add_skip_layer
<
tag2
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip3
=
add_skip_layer
<
tag3
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip4
=
add_skip_layer
<
tag4
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip5
=
add_skip_layer
<
tag5
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip6
=
add_skip_layer
<
tag6
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip7
=
add_skip_layer
<
tag7
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip8
=
add_skip_layer
<
tag8
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip9
=
add_skip_layer
<
tag9
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip10
=
add_skip_layer
<
tag10
,
SUB_NET
>
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
template
<
...
...
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