mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Do the bias addition in the convolution in a separate call (#2656)
* Do the bias addition in the convolution in a separate call Fixes #2655. Somehow, doing it in a single call is slower. * Grammar * The change should be this, really
This commit is contained in:
parent
da2f45b2e5
commit
902c70193a
@ -232,19 +232,18 @@ namespace dlib
|
|||||||
_stride_x,
|
_stride_x,
|
||||||
padding_y_,
|
padding_y_,
|
||||||
padding_x_);
|
padding_x_);
|
||||||
|
|
||||||
|
conv(false, output,
|
||||||
|
sub.get_output(),
|
||||||
|
filters(params,0));
|
||||||
|
|
||||||
|
// For some reason, doing this is sometimes slower than two separate calls
|
||||||
|
// conv(false, output,
|
||||||
|
// sub.get_output(),
|
||||||
|
// filters(params,0),
|
||||||
|
// biases(params, filters.size()));
|
||||||
if (use_bias)
|
if (use_bias)
|
||||||
{
|
tt::add(1,output,1,biases(params,filters.size()));
|
||||||
conv(false, output,
|
|
||||||
sub.get_output(),
|
|
||||||
filters(params,0),
|
|
||||||
biases(params, filters.size()));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
conv(false, output,
|
|
||||||
sub.get_output(),
|
|
||||||
filters(params,0));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename SUBNET>
|
template <typename SUBNET>
|
||||||
|
Loading…
Reference in New Issue
Block a user