convnade.py 文件源码

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

项目:NADE 作者: MarcCote 项目源码 文件源码
def get_output(self, X):
        convnet_output = 0
        if self.has_convnet:
            # Hack: input_masked is a 2D matrix instead of a 4D tensor, but we have all the information to fix that.
            input_4D = X.reshape((-1, self.nb_channels) + self.image_shape)
            convnet_output = self.convnet.get_output(input_4D)  # Returns the convnet's output preactivation.

            # This will generate a matrix of shape (batch_size, nb_kernels * kernel_height * kernel_width).
            convnet_output = convnet_output.flatten(2)

        fullnet_output = 0
        if self.has_fullnet:
            fullnet_output = self.fullnet.get_output(X)  # Returns the fullnet's output preactivation.

        output = convnet_output + fullnet_output
        # TODO: sigmoid should be applied here instead of within loss function.
        return output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号