提交 d04ced5e authored 作者: Frederic Bastien's avatar Frederic Bastien

convolve2() now accept a dict that it forward to ConvOp

上级 3be32835
...@@ -187,7 +187,7 @@ using namespace std; ...@@ -187,7 +187,7 @@ using namespace std;
return _conv_op_code_a % d return _conv_op_code_a % d
def convolve2(kerns, kshp, nkern, images, imshp, bsize, step=(1,1), def convolve2(kerns, kshp, nkern, images, imshp, bsize, step=(1,1),
bias=None, mode='valid'): bias=None, mode='valid', **d):
# if imshp, is a tuple, images contains one input dimension # if imshp, is a tuple, images contains one input dimension
nvis_dim = 1 if len(imshp)!=3 else imshp[0] nvis_dim = 1 if len(imshp)!=3 else imshp[0]
...@@ -199,7 +199,7 @@ def convolve2(kerns, kshp, nkern, images, imshp, bsize, step=(1,1), ...@@ -199,7 +199,7 @@ def convolve2(kerns, kshp, nkern, images, imshp, bsize, step=(1,1),
kernrshp = tensor.as_tensor([nkern, nvis_dim] + list(kshp)) kernrshp = tensor.as_tensor([nkern, nvis_dim] + list(kshp))
kerntensor = tensor.reshape(kerns, kernrshp) kerntensor = tensor.reshape(kerns, kernrshp)
convop = ConvOp(imshp, kshp, nkern, bsize, 1, 1, output_mode=mode) convop = ConvOp(imshp, kshp, nkern, bsize, 1, 1, output_mode=mode,**d)
convout = convop(imtensor, kerntensor) convout = convop(imtensor, kerntensor)
if bias: if bias:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论