test_convolutional.py 文件源码

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

项目:deep-coref 作者: clarkkev 项目源码 文件源码
def test_zero_padding_2d(self):
        nb_samples = 9
        stack_size = 7
        input_nb_row = 11
        input_nb_col = 12

        input = np.ones((nb_samples, stack_size, input_nb_row, input_nb_col))
        layer = convolutional.ZeroPadding2D(padding=(2, 2))
        layer.input = theano.shared(value=input)
        for train in [True, False]:
            out = layer.get_output(train).eval()
            for offset in [0, 1, -1, -2]:
                assert_allclose(out[:, :, offset, :], 0.)
                assert_allclose(out[:, :, :, offset], 0.)
            assert_allclose(out[:, :, 2:-2, 2:-2], 1.)

        config = layer.get_config()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号