提交 3d65fadf authored 作者: gdesjardins's avatar gdesjardins

fixed bug in conv2d

上级 f2887ce2
...@@ -37,7 +37,6 @@ def conv2d(input, filters, border_mode='valid', subsample=(1,1), ...@@ -37,7 +37,6 @@ def conv2d(input, filters, border_mode='valid', subsample=(1,1),
:type filter_shape: tuple of len 4 :type filter_shape: tuple of len 4
:param filter_shape: (nb kernel, stack size, nb row, nb col) :param filter_shape: (nb kernel, stack size, nb row, nb col)
""" """
if image_shape and filter_shape: if image_shape and filter_shape:
assert image_shape[1]==filter_shape[1] assert image_shape[1]==filter_shape[1]
...@@ -49,11 +48,15 @@ def conv2d(input, filters, border_mode='valid', subsample=(1,1), ...@@ -49,11 +48,15 @@ def conv2d(input, filters, border_mode='valid', subsample=(1,1),
if image_shape is not None: if image_shape is not None:
bsize = image_shape[0] bsize = image_shape[0]
imshp = imshp[1:] imshp = image_shape[1:]
else: else:
bsize, imshp = None, None bsize, imshp = None, None
print 'imshp = ', imshp
print 'kshp = ', kshp
print 'nkern = ', nkern
print 'bsize = ', bsize
op = ConvOp(output_mode=border_mode, dx=subsample[0], dy=subsample[1], op = ConvOp(output_mode=border_mode, dx=subsample[0], dy=subsample[1],
imshp=imshp, kshp=kshp, nkern=nkern, bsize=bsize,**kargs) imshp=imshp, kshp=kshp, nkern=nkern, bsize=bsize,**kargs)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论