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
feb81e1f
Commit
feb81e1f
authored
Apr 10, 2016
by
Davis King
Browse files
Made fc<> always use a bias and added an fc_no_bias<> for the other case.
parent
6acddf99
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
dlib/dnn/layers.h
dlib/dnn/layers.h
+7
-2
dlib/dnn/layers_abstract.h
dlib/dnn/layers_abstract.h
+6
-2
dlib/test/dnn.cpp
dlib/test/dnn.cpp
+3
-1
No files found.
dlib/dnn/layers.h
View file @
feb81e1f
...
@@ -705,10 +705,15 @@ namespace dlib
...
@@ -705,10 +705,15 @@ namespace dlib
template
<
template
<
unsigned
long
num_outputs
,
unsigned
long
num_outputs
,
fc_bias_mode
bias_mode
,
typename
SUBNET
typename
SUBNET
>
>
using
fc
=
add_layer
<
fc_
<
num_outputs
,
bias_mode
>
,
SUBNET
>
;
using
fc
=
add_layer
<
fc_
<
num_outputs
,
FC_HAS_BIAS
>
,
SUBNET
>
;
template
<
unsigned
long
num_outputs
,
typename
SUBNET
>
using
fc_no_bias
=
add_layer
<
fc_
<
num_outputs
,
FC_NO_BIAS
>
,
SUBNET
>
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
dlib/dnn/layers_abstract.h
View file @
feb81e1f
...
@@ -396,13 +396,17 @@ namespace dlib
...
@@ -396,13 +396,17 @@ namespace dlib
!*/
!*/
};
};
template
<
unsigned
long
num_outputs
,
typename
SUBNET
>
using
fc
=
add_layer
<
fc_
<
num_outputs
,
FC_HAS_BIAS
>
,
SUBNET
>
;
template
<
template
<
unsigned
long
num_outputs
,
unsigned
long
num_outputs
,
fc_bias_mode
bias_mode
,
typename
SUBNET
typename
SUBNET
>
>
using
fc
=
add_layer
<
fc_
<
num_outputs
,
bias_mode
>
,
SUBNET
>
;
using
fc
_no_bias
=
add_layer
<
fc_
<
num_outputs
,
FC_NO_BIAS
>
,
SUBNET
>
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
dlib/test/dnn.cpp
View file @
feb81e1f
...
@@ -1176,7 +1176,7 @@ namespace
...
@@ -1176,7 +1176,7 @@ namespace
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
unsigned
long
n
,
typename
SUBNET
>
using
rcon
=
max_pool
<
2
,
2
,
2
,
2
,
relu
<
bn_con
<
con
<
n
,
5
,
5
,
1
,
1
,
SUBNET
>>>>
;
template
<
unsigned
long
n
,
typename
SUBNET
>
using
rcon
=
max_pool
<
2
,
2
,
2
,
2
,
relu
<
bn_con
<
con
<
n
,
5
,
5
,
1
,
1
,
SUBNET
>>>>
;
template
<
unsigned
long
n
,
typename
SUBNET
>
using
rfc
=
relu
<
bn_fc
<
fc
<
n
,
FC_HAS_BIAS
,
SUBNET
>>>
;
template
<
unsigned
long
n
,
typename
SUBNET
>
using
rfc
=
relu
<
bn_fc
<
fc
<
n
,
SUBNET
>>>
;
void
test_tagging
(
void
test_tagging
(
)
)
...
@@ -1190,6 +1190,8 @@ namespace
...
@@ -1190,6 +1190,8 @@ namespace
DLIB_TEST
(
layer
<
skip1
>
(
net
).
num_layers
==
8
+
3
+
3
);
DLIB_TEST
(
layer
<
skip1
>
(
net
).
num_layers
==
8
+
3
+
3
);
DLIB_TEST
(
&
layer
<
skip1
>
(
net
).
get_output
()
==
&
layer
<
tag1
>
(
net
).
get_output
());
DLIB_TEST
(
&
layer
<
skip1
>
(
net
).
get_output
()
==
&
layer
<
tag1
>
(
net
).
get_output
());
DLIB_TEST
(
&
layer
<
skip1
>
(
net
).
get_output
()
!=
&
layer
<
tag1
>
(
net
).
subnet
().
subnet
().
get_output
());
DLIB_TEST
(
&
layer
<
skip1
>
(
net
).
get_output
()
!=
&
layer
<
tag1
>
(
net
).
subnet
().
subnet
().
get_output
());
DLIB_TEST
(
net
.
subnet
().
subnet
().
subnet
().
layer_details
().
get_num_outputs
()
==
10
);
DLIB_TEST
(
net2
.
subnet
().
subnet
().
subnet
().
layer_details
().
get_num_outputs
()
==
4
);
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
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