提交 2d29bb3c authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix the output shape in python to match the C code for DownsampleFactorMaxGradGrad.

上级 8a736df5
...@@ -934,8 +934,8 @@ class DownsampleFactorMaxGradGrad(Op): ...@@ -934,8 +934,8 @@ class DownsampleFactorMaxGradGrad(Op):
if len(x.shape) != 4: if len(x.shape) != 4:
raise NotImplementedError( raise NotImplementedError(
'DownsampleFactorMaxGradGrad requires 4D input for now') 'DownsampleFactorMaxGradGrad requires 4D input for now')
if (z[0] is None) or (z[0].shape != x.shape): if (z[0] is None) or (z[0].shape != maxout.shape):
z[0] = numpy.zeros(x.shape, dtype=x.dtype) z[0] = numpy.zeros(maxout.shape, dtype=x.dtype)
ggz = z[0] # grad wrt maxout_grad has the same shape as maxout ggz = z[0] # grad wrt maxout_grad has the same shape as maxout
# number of pooling output rows # number of pooling output rows
pr = ggz.shape[-2] pr = ggz.shape[-2]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论