提交 4c973fcf authored 作者: Marius Killinger's avatar Marius Killinger 提交者: Frederic

Fix for degenerate filters in conv3d2d

上级 4410fb0f
...@@ -254,7 +254,16 @@ def conv3d(signals, filters, ...@@ -254,7 +254,16 @@ def conv3d(signals, filters,
# now sum out along the Tf to get the output # now sum out along the Tf to get the output
# but we have to sum on a diagonal through the Tf and Ts submatrix. # but we have to sum on a diagonal through the Tf and Ts submatrix.
if border_mode[0] == 'valid': if border_mode[0] == 'valid':
out_5d = diagonal_subtensor(out_tmp, 1, 3).sum(axis=3) if filters_shape[1]!=1:
out_5d = diagonal_subtensor(out_tmp, 1, 3).sum(axis=3)
else: # for Tf==1, no sum along Tf, the Ts-axis of the output is unchanged!
out_5d = out_tmp.reshape((
_signals_shape_5d[0],
_signals_shape_5d[1],
_filters_shape_5d[0],
_signals_shape_5d[3] - _filters_shape_5d[3] + 1,
_signals_shape_5d[4] - _filters_shape_5d[4] + 1,
))
elif border_mode[0] in ('full', 'same'): elif border_mode[0] in ('full', 'same'):
raise NotImplementedError('sequence border mode', border_mode[0]) raise NotImplementedError('sequence border mode', border_mode[0])
else: else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论