vgg.py 文件源码

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

项目:chainer-visualization 作者: hvy 项目源码 文件源码
def feature_map_activations(self, x):

        """Forward pass through the convolutional layers of the VGG returning
        all of its intermediate feature map activations."""

        hs = []
        pre_pooling_sizes = []

        h = x
        for conv_block, mp in zip(self.conv_blocks, self.mps):
            for conv in conv_block:
                h = F.relu(conv(h))

            pre_pooling_sizes.append(h.data.shape[2:])

            # Disable cuDNN, else pooling indices will not be stored
            with chainer.using_config('use_cudnn', 'never'):
                h = mp.apply((h,))[0]
            hs.append(h)

        return hs, pre_pooling_sizes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号