bc5e993ae30a59d7bcdfa03513ecc3d43b58a5f7,tests/auto/keras/layers/test_core.py,TestMasking,test_non_zero,#TestMasking#,131

Before Change


        Test masking with non-zero mask value
        layer = core.Masking(5)
        func = theano.function([layer.input], layer.get_output_mask())
        self.assertTrue(np.all(
            // get mask for this input, if not all the values are 5, shouldn"t masked
            func(np.array([[[1, 1], [2, 1], [3, 1], [5, 5]],
                          [[1, 5], [5, 0], [0, 0], [0, 0]]], dtype=np.int32)) ==
            // This is the expected output mask, one dimension less
            np.array([[1, 1, 1, 0], [1, 1, 1, 1]])))

    def test_non_zero_output(self):
        Test output of masking layer with non-zero mask value
        layer = core.Masking(5)

After Change


        Test masking with non-zero mask value
        layer = core.Masking(5)
        func = K.function([layer.input], [layer.get_output_mask()])
        input_data = np.array([[[1, 1], [2, 1], [3, 1], [5, 5]],
                              [[1, 5], [5, 0], [0, 0], [0, 0]]],
                              dtype=np.int32)
        output = func([input_data])[0]
        expected = np.array([[1, 1, 1, 0], [1, 1, 1, 1]])
        self.assertTrue(np.all(output == expected))

    def test_non_zero_output(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: keras-team/keras
Commit Name: bc5e993ae30a59d7bcdfa03513ecc3d43b58a5f7
Time: 2015-11-19
Author: francois.chollet@gmail.com
File Name: tests/auto/keras/layers/test_core.py
Class Name: TestMasking
Method Name: test_non_zero


Project Name: keras-team/keras
Commit Name: bc5e993ae30a59d7bcdfa03513ecc3d43b58a5f7
Time: 2015-11-19
Author: francois.chollet@gmail.com
File Name: tests/auto/keras/layers/test_core.py
Class Name: TestMasking
Method Name: test_sequences


Project Name: keras-team/keras
Commit Name: bc5e993ae30a59d7bcdfa03513ecc3d43b58a5f7
Time: 2015-11-19
Author: francois.chollet@gmail.com
File Name: tests/auto/keras/layers/test_core.py
Class Name: TestMasking
Method Name: test_non_zero_output