Commit 5806275c authored by Davis King's avatar Davis King

Added set_num_outputs() to fc_ layer.

parent 10b4f825
...@@ -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; }
......
...@@ -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;
/*! /*!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment