Theano中卷积神经网络的无监督预训练

时间:2014-07-15 07:47:24

标签: python neural-network theano deep-learning unsupervised-learning

我想设计一个带有一个(或多个)卷积层(CNN)的深网和顶部有一个或多个完全连接的隐藏层。
对于具有完全连接层的深层网络,theano中有无人监督的预训练方法,例如使用denoising auto-encodersRBMs

我的问题是:我如何实现(在theano中)卷积层的无监督预训练阶段?

我不希望将完整的实现作为答案,但我希望链接到一个好的教程或可靠的参考。

1 个答案:

答案 0 :(得分:30)

This paper描述了构建堆叠卷积自动编码器的方法。根据该论文和一些谷歌搜索,我能够实现所描述的网络。基本上,你需要的一切都在Theano卷积网络和去噪自动编码器教程中描述,但有一个关键的例外:如何反转卷积网络中的最大池化步骤。我能够使用this discussion中的方法解决这个问题 - 最棘手的部分是确定W_prime的正确尺寸,因为这些将取决于前馈滤波器大小和合并比率。这是我的反转功能:

    def get_reconstructed_input(self, hidden):
        """ Computes the reconstructed input given the values of the hidden layer """
        repeated_conv = conv.conv2d(input = hidden, filters = self.W_prime, border_mode='full')

        multiple_conv_out = [repeated_conv.flatten()] * np.prod(self.poolsize)

        stacked_conv_neibs = T.stack(*multiple_conv_out).T

        stretch_unpooling_out = neibs2images(stacked_conv_neibs, self.pl, self.x.shape)

        rectified_linear_activation = lambda x: T.maximum(0.0, x)
        return rectified_linear_activation(stretch_unpooling_out + self.b_prime.dimshuffle('x', 0, 'x', 'x'))
相关问题