我想设计一个具有一个(或多个)卷积层 (CNN) 和一个或多个顶部全连接隐藏层的深度网络。
对于具有完全连接层的深度网络,theano 中有用于无监督预训练的方法,例如,使用 denoising auto-encoders或 RBMs .
我的问题是:如何(在 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/