Esempio n. 1
0
    def test_mask_to_parent(self):
        """
        Test the mask handling in Gate node
        """

        X = GaussianARD(2, 1, shape=(4, 5), plates=(3, 2))
        F = Gate([0, 0, 1], X)

        self.assertAllClose(
            F._compute_weights_to_parent(0, [True, False, False]),
            [True, False, False])
        self.assertAllClose(
            F._compute_weights_to_parent(1, [True, False, False]),
            [[True], [False], [False]])

        pass
Esempio n. 2
0
    def test_mask_to_parent(self):
        """
        Test the mask handling in Gate node
        """

        X = GaussianARD(2, 1, shape=(4, 5), plates=(3, 2))
        F = Gate([0, 0, 1], X)

        self.assertAllClose(
            F._compute_weights_to_parent(0, [True, False, False]),
            [True, False, False]
        )
        self.assertAllClose(
            F._compute_weights_to_parent(1, [True, False, False]),
            [[True], [False], [False]]
        )

        pass