lasagne 1D和2D卷积

lasagne卷积源码:
https://github.com/Lasagne/Lasagne/blob/master/lasagne/layers/conv.py#L386-L517,其中 class Conv1DLayer ( BaseConvLayer ): 中 convolution=conv.conv1d_mc0, **kwargs):
class Conv2DLayer ( BaseConvLayer ): 中 convolution=T.nnet.conv2d, **kwargs):

from ..theano_extensions import conv
查看函数conv

def conv1d_mc0(input, filters, image_shape=None, filter_shape=None,
               border_mode='valid', subsample=(1,), filter_flip=True,
               num_groups=1):
    """
    using conv2d with width == 1,(b, c, i0) to (b, c, 1, i0)
    """
也就是1D就是将2D的宽设为1,所以从2D到1D就是将输入参数改变一下
   


你可能感兴趣的:(lasagne 1D和2D卷积)