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
5c8a2a4c
Commit
5c8a2a4c
authored
Sep 23, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed classes
parent
163da43e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
45 deletions
+45
-45
core.h
dlib/dnn/core.h
+0
-0
core_abstract.h
dlib/dnn/core_abstract.h
+43
-43
loss.h
dlib/dnn/loss.h
+2
-2
No files found.
dlib/dnn/core.h
View file @
5c8a2a4c
This diff is collapsed.
Click to expand it.
dlib/dnn/core_abstract.h
View file @
5c8a2a4c
...
@@ -138,8 +138,8 @@ namespace dlib
...
@@ -138,8 +138,8 @@ namespace dlib
- SUB_NET implements the input interface (TODO clarify) defined in
- SUB_NET implements the input interface (TODO clarify) 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 object.
- SUB_NET is an add_tag
_layer
object.
- SUB_NET is an add_skip object.
- SUB_NET is an add_skip
_layer
object.
WHAT THIS OBJECT REPRESENTS
WHAT THIS OBJECT REPRESENTS
Stacks a new layer, defined by LAYER_DETAILS, on top of SUB_NET type.
Stacks a new layer, defined by LAYER_DETAILS, on top of SUB_NET type.
...
@@ -334,7 +334,7 @@ namespace dlib
...
@@ -334,7 +334,7 @@ namespace dlib
typename
LOSS_DETAILS
,
typename
LOSS_DETAILS
,
typename
SUB_NET
typename
SUB_NET
>
>
class
add_loss
class
add_loss
_layer
{
{
/*!
/*!
REQUIREMENTS ON LOSS_DETAILS
REQUIREMENTS ON LOSS_DETAILS
...
@@ -346,8 +346,8 @@ namespace dlib
...
@@ -346,8 +346,8 @@ 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 is an add_layer object.
- SUB_NET is an add_layer object.
- SUB_NET is an add_tag object.
- SUB_NET is an add_tag
_layer
object.
- SUB_NET is an add_skip object.
- SUB_NET is an add_skip
_layer
object.
WHAT THIS OBJECT REPRESENTS
WHAT THIS OBJECT REPRESENTS
- Adds a loss layer, defined by LOSS_DETAILS, on top of SUB_NET.
- Adds a loss layer, defined by LOSS_DETAILS, on top of SUB_NET.
...
@@ -368,22 +368,22 @@ namespace dlib
...
@@ -368,22 +368,22 @@ namespace dlib
"The loss layer and input layer must agree on the sample_expansion_factor."
);
"The loss layer and input layer must agree on the sample_expansion_factor."
);
add_loss
()
=
default
;
add_loss
_layer
()
=
default
;
add_loss
(
const
add_loss
&
)
=
default
;
add_loss
_layer
(
const
add_loss_layer
&
)
=
default
;
add_loss
(
add_loss
&&
)
=
default
;
add_loss
_layer
(
add_loss_layer
&&
)
=
default
;
add_loss
&
operator
=
(
add_loss
&&
)
=
default
;
add_loss
_layer
&
operator
=
(
add_loss_layer
&&
)
=
default
;
add_loss
&
operator
=
(
const
add_loss
&
)
=
default
;
add_loss
_layer
&
operator
=
(
const
add_loss_layer
&
)
=
default
;
template
<
typename
T
,
typename
U
>
template
<
typename
T
,
typename
U
>
add_loss
(
add_loss
_layer
(
const
add_loss
<
T
,
U
>&
item
const
add_loss
_layer
<
T
,
U
>&
item
)
:
)
:
loss
(
item
.
loss_details
()),
loss
(
item
.
loss_details
()),
sub
(
item
.
sub_net
())
sub
(
item
.
sub_net
())
{}
{}
template
<
typename
...
T
>
template
<
typename
...
T
>
add_loss
(
add_loss
_layer
(
const
LOSS_DETAILS
&
layer_det
,
const
LOSS_DETAILS
&
layer_det
,
T
&&
...
args
T
&&
...
args
)
:
)
:
...
@@ -393,7 +393,7 @@ namespace dlib
...
@@ -393,7 +393,7 @@ namespace dlib
}
}
template
<
typename
...
T
>
template
<
typename
...
T
>
add_loss
(
add_loss
_layer
(
LOSS_DETAILS
&&
layer_det
,
LOSS_DETAILS
&&
layer_det
,
T
&&
...
args
T
&&
...
args
)
:
)
:
...
@@ -403,7 +403,7 @@ namespace dlib
...
@@ -403,7 +403,7 @@ namespace dlib
}
}
template
<
typename
...
T
>
template
<
typename
...
T
>
add_loss
(
add_loss
_layer
(
T
...
args
T
...
args
)
:
)
:
sub
(
std
::
move
(
args
)...)
sub
(
std
::
move
(
args
)...)
...
@@ -519,7 +519,7 @@ namespace dlib
...
@@ -519,7 +519,7 @@ namespace dlib
template
<
typename
T
,
typename
U
>
template
<
typename
T
,
typename
U
>
struct
is_layer_type
<
add_loss
<
T
,
U
>>
:
std
::
true_type
{};
struct
is_layer_type
<
add_loss
_layer
<
T
,
U
>>
:
std
::
true_type
{};
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -534,7 +534,7 @@ namespace dlib
...
@@ -534,7 +534,7 @@ namespace dlib
);
);
/*!
/*!
requires
requires
- net_type is an object of type add_layer, add_loss
, add_skip, or add_tag
.
- net_type is an object of type add_layer, add_loss
_layer, add_skip_layer, or add_tag_layer
.
ensures
ensures
- This function chains together i calls to n.sub_net() and returns the
- This function chains together i calls to n.sub_net() and returns the
result. So for example:
result. So for example:
...
@@ -559,7 +559,7 @@ namespace dlib
...
@@ -559,7 +559,7 @@ namespace dlib
);
);
/*!
/*!
requires
requires
- net_type is an object of type add_layer, add_loss
, add_skip, or add_tag
.
- net_type is an object of type add_layer, add_loss
_layer, add_skip_layer, or add_tag_layer
.
ensures
ensures
- returns the first layer in n that is of type Match. E.g. if net_type is
- returns the first layer in n that is of type Match. E.g. if net_type is
fc<relu<fc<input<sample_type>>>> then calling layer<relu>(n) would return
fc<relu<fc<input<sample_type>>>> then calling layer<relu>(n) would return
...
@@ -576,7 +576,7 @@ namespace dlib
...
@@ -576,7 +576,7 @@ namespace dlib
);
);
/*!
/*!
requires
requires
- net_type is an object of type add_layer, add_loss
, add_skip, or add_tag
.
- net_type is an object of type add_layer, add_loss
_layer, add_skip_layer, or add_tag_layer
.
ensures
ensures
- returns layer<i>(layer<Match>(n))
- returns layer<i>(layer<Match>(n))
!*/
!*/
...
@@ -587,28 +587,28 @@ namespace dlib
...
@@ -587,28 +587,28 @@ namespace dlib
unsigned
long
ID
,
unsigned
long
ID
,
typename
SUB_NET
typename
SUB_NET
>
>
class
add_tag
class
add_tag
_layer
{
{
/*!
/*!
WHAT THIS OBJECT REPRESENTS
WHAT THIS OBJECT REPRESENTS
This object draws its inputs from sub_net() and performs the identity
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
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
the behavior of the network. It exists solely to be used by add_skip
_layer
to reference a particular part of a network.
to reference a particular part of a network.
!*/
!*/
};
};
template
<
typename
SUB_NET
>
using
tag1
=
add_tag
<
1
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag1
=
add_tag
_layer
<
1
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag2
=
add_tag
<
2
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag2
=
add_tag
_layer
<
2
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag3
=
add_tag
<
3
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag3
=
add_tag
_layer
<
3
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag4
=
add_tag
<
4
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag4
=
add_tag
_layer
<
4
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag5
=
add_tag
<
5
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag5
=
add_tag
_layer
<
5
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag6
=
add_tag
<
6
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag6
=
add_tag
_layer
<
6
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag7
=
add_tag
<
7
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag7
=
add_tag
_layer
<
7
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag8
=
add_tag
<
8
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag8
=
add_tag
_layer
<
8
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag9
=
add_tag
<
9
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag9
=
add_tag
_layer
<
9
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag10
=
add_tag
<
10
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
tag10
=
add_tag
_layer
<
10
,
SUB_NET
>
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -616,7 +616,7 @@ namespace dlib
...
@@ -616,7 +616,7 @@ namespace dlib
template
<
typename
>
class
TAG_TYPE
,
template
<
typename
>
class
TAG_TYPE
,
typename
SUB_NET
typename
SUB_NET
>
>
class
add_skip
class
add_skip
_layer
{
{
/*!
/*!
WHAT THIS OBJECT REPRESENTS
WHAT THIS OBJECT REPRESENTS
...
@@ -625,16 +625,16 @@ namespace dlib
...
@@ -625,16 +625,16 @@ namespace dlib
!*/
!*/
};
};
template
<
typename
SUB_NET
>
using
skip1
=
add_skip
<
tag1
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip1
=
add_skip
_layer
<
tag1
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip2
=
add_skip
<
tag2
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip2
=
add_skip
_layer
<
tag2
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip3
=
add_skip
<
tag3
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip3
=
add_skip
_layer
<
tag3
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip4
=
add_skip
<
tag4
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip4
=
add_skip
_layer
<
tag4
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip5
=
add_skip
<
tag5
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip5
=
add_skip
_layer
<
tag5
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip6
=
add_skip
<
tag6
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip6
=
add_skip
_layer
<
tag6
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip7
=
add_skip
<
tag7
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip7
=
add_skip
_layer
<
tag7
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip8
=
add_skip
<
tag8
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip8
=
add_skip
_layer
<
tag8
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip9
=
add_skip
<
tag9
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip9
=
add_skip
_layer
<
tag9
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip10
=
add_skip
<
tag10
,
SUB_NET
>
;
template
<
typename
SUB_NET
>
using
skip10
=
add_skip
_layer
<
tag10
,
SUB_NET
>
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -663,7 +663,7 @@ namespace dlib
...
@@ -663,7 +663,7 @@ namespace dlib
{
{
/*!
/*!
REQUIREMENTS ON net_type
REQUIREMENTS ON net_type
- net_type is an add_loss object.
- net_type is an add_loss
_layer
object.
REQUIREMENTS ON solver_type
REQUIREMENTS ON solver_type
- solver_type is an implementation of the EXAMPLE_SOLVER interface defined
- solver_type is an implementation of the EXAMPLE_SOLVER interface defined
...
...
dlib/dnn/loss.h
View file @
5c8a2a4c
...
@@ -117,7 +117,7 @@ namespace dlib
...
@@ -117,7 +117,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
SUB_NET
>
template
<
typename
SUB_NET
>
using
loss_binary_hinge
=
add_loss
<
loss_binary_hinge_
,
SUB_NET
>
;
using
loss_binary_hinge
=
add_loss
_layer
<
loss_binary_hinge_
,
SUB_NET
>
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -164,7 +164,7 @@ namespace dlib
...
@@ -164,7 +164,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
SUB_NET
>
template
<
typename
SUB_NET
>
using
loss_no_label
=
add_loss
<
loss_no_label_
,
SUB_NET
>
;
using
loss_no_label
=
add_loss
_layer
<
loss_no_label_
,
SUB_NET
>
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
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