python - theano中卷积神经网络的无监督预训练

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

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

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

我不希望一个完整的实现作为答案,但我希望能提供一个好的教程或可靠引用的链接。

最佳答案

This paper描述了一种构建堆叠卷积自动编码器的方法。基于那篇论文和一些谷歌搜索,我能够实现所描述的网络。基本上,您需要的一切都在 Theano 卷积网络和去噪自动编码器教程中进行了描述,但有一个关键异常(exception):如何反转卷积网络中的最大池化步骤。我能够使用 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'))

关于python - theano中卷积神经网络的无监督预训练,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24752655/

相关文章:

python - Keras 段错误(核心已转储)

theano - 在 Theano 中获取张量变量的值

python - 这个怎么解析呢?尝试使用 BeautifulSoup 和 Python 从非 HTML 网页提取数据

python - Pandas - 如果列较大且不为空则生成值

python - 阅读时使用 np.loadtxt 拆分列

machine-learning - 将 Python 创建的神经网络导出到 CoreML,这可能吗?

python - Theano 无法使用 theano 配置 cnmem = 1 导入

python - 如何使用 python 和 Mechanize 模拟 AJAX 调用(XHR)

java - 随机梯度下降未能在我的神经网络实现中收敛

machine-learning - 异构数据分类器