508545f2c9a982a38a243ec95c7a5cdd266ed358,pygsp/tests/test_graphs.py,TestCase,test_degree,#TestCase#,46

Before Change


        self.assertEqual(kj.shape[0], G.Ne)

    def test_degree(self):
        W = np.arange(1,17).reshape(4, 4)
        G = graphs.Graph(W)
        d = 4*np.ones([4])
        dw = np.sum(W,axis=1).squeeze()
        self.assertAlmostEqual(np.linalg.norm(G.d-d),0)
        self.assertAlmostEqual(np.linalg.norm(G.dw-dw),0)

        G = graphs.Sensor()

After Change


        self.assertEqual(kj.shape[0], G.Ne)

    def test_degree(self):
        W = 0.3 * (np.ones((4, 4)) - np.diag(4 * [1]))
        G = graphs.Graph(W)
        A = np.ones(W.shape) - np.diag(np.ones(4))
        np.testing.assert_allclose(G.A.toarray(), A)
        np.testing.assert_allclose(G.d, 3 * np.ones([4]))
        np.testing.assert_allclose(G.dw, 3 * 0.3)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: epfl-lts2/pygsp
Commit Name: 508545f2c9a982a38a243ec95c7a5cdd266ed358
Time: 2017-11-23
Author: michael.defferrard@epfl.ch
File Name: pygsp/tests/test_graphs.py
Class Name: TestCase
Method Name: test_degree


Project Name: eriklindernoren/Keras-GAN
Commit Name: 3cba7783cb805459d26918be7a56b0e8b8fd3bc9
Time: 2017-07-17
Author: eriklindernoren@live.se
File Name: gan.py
Class Name: GAN
Method Name: train


Project Name: nilearn/nilearn
Commit Name: a04fdeac1f3d7ad8f0e49393bb48e090c124ef99
Time: 2017-11-17
Author: jerome@dockes.org
File Name: nilearn/datasets/tests/test_atlas.py
Class Name:
Method Name: test_fetch_atlas_talairach