conv_pool.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:Buffe 作者: bentzinir 项目源码 文件源码
def step(self, input):

        # self.input = input

        # convolve input feature maps with filters
        # conv_out = t.conv.conv2d(
        #     input=input,
        #     filters=self.W,
        #     filter_shape=filter_shape,
        #     image_shape=image_shape
        # )

        conv_out = conv.conv2d(
            input=input,
            filters=self.W,
            filter_shape=self.filter_shape,
            image_shape=self.image_shape,
            border_mode=self.border_mode
        )
        # downsample each feature map individually, using maxpooling
        pooled_out = downsample.max_pool_2d(
            input=conv_out,
            ds=self.poolsize,
            ignore_border=True,
        )

        # add the bias term. Since the bias is a vector (1D array), we first
        # reshape it to a tensor of shape (1, n_filters, 1, 1). Each bias will
        # thus be broadcasted across mini-batches and feature map
        # width & height
        output = tt.tanh(pooled_out + self.b.dimshuffle('x', 0, 'x', 'x'))

        return output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号