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
5806275c
Commit
5806275c
authored
Oct 28, 2017
by
Davis King
Browse files
Added set_num_outputs() to fc_ layer.
parent
10b4f825
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
dlib/dnn/layers.h
dlib/dnn/layers.h
+11
-0
dlib/dnn/layers_abstract.h
dlib/dnn/layers_abstract.h
+13
-0
No files found.
dlib/dnn/layers.h
View file @
5806275c
...
@@ -1448,6 +1448,17 @@ namespace dlib
...
@@ -1448,6 +1448,17 @@ namespace dlib
unsigned
long
get_num_outputs
(
unsigned
long
get_num_outputs
(
)
const
{
return
num_outputs
;
}
)
const
{
return
num_outputs
;
}
void
set_num_outputs
(
long
num
)
{
DLIB_CASSERT
(
num
>
0
);
if
(
num
!=
num_outputs
)
{
DLIB_CASSERT
(
get_layer_params
().
size
()
==
0
,
"You can't change the number of filters in fc_ if the parameter tensor has already been allocated."
);
num_outputs
=
num
;
}
}
fc_bias_mode
get_bias_mode
(
fc_bias_mode
get_bias_mode
(
)
const
{
return
bias_mode
;
}
)
const
{
return
bias_mode
;
}
...
...
dlib/dnn/layers_abstract.h
View file @
5806275c
...
@@ -475,6 +475,19 @@ namespace dlib
...
@@ -475,6 +475,19 @@ namespace dlib
- The rest of the dimensions of T will be 1.
- The rest of the dimensions of T will be 1.
!*/
!*/
void
set_num_outputs
(
long
num
);
/*!
requires
- num > 0
- get_layer_params().size() == 0 || get_num_outputs() == num
(i.e. You can't change the number of outputs in fc_ if the parameter
tensor has already been allocated.)
ensures
- #get_num_outputs() == num
!*/
fc_bias_mode
get_bias_mode
(
fc_bias_mode
get_bias_mode
(
)
const
;
)
const
;
/*!
/*!
...
...
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