04f7a2ae65a7f4c43153452922a8fae2c4b555d1,tests/test_manifold_fixed_rank.py,TestFixedRankEmbeddedManifold,test_proj,#TestFixedRankEmbeddedManifold#,41

Before Change


        u = e.randvec(x)
        A = e.proj(x, u)
        B = u
        diff = [A[k]-B[k] for k in xrange(len(A))]
        np_testing.assert_almost_equal(e.norm(x, diff), 0)

    def test_norm(self):
        e = self.man

After Change


        // the distance.
        m = self.man
        x = self.man.rand()
        v = np.random.randn(self.m, self.n)

        g = m.proj(x, v)
        // Displace g a little
        g_disp = g + 0.01 * m.randvec(x)

        // Return to the ambient representation
        g = m.tangent2ambient(x, g)
        g_disp = m.tangent2ambient(x, g_disp)
        g = g[0].dot(g[1]).dot(g[2].T)
        g_disp = g_disp[0].dot(g_disp[1]).dot(g_disp[2].T)

        assert np.linalg.norm(g - v) > np.linalg.norm(g_disp - v)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pymanopt/pymanopt
Commit Name: 04f7a2ae65a7f4c43153452922a8fae2c4b555d1
Time: 2016-07-28
Author: jamiehntownsend@gmail.com
File Name: tests/test_manifold_fixed_rank.py
Class Name: TestFixedRankEmbeddedManifold
Method Name: test_proj


Project Name: mne-tools/mne-python
Commit Name: 0656d8eef747ecb0d86631c18675feba3ab1fcae
Time: 2019-02-15
Author: alexandre.gramfort@m4x.org
File Name: mne/simulation/evoked.py
Class Name:
Method Name: _generate_noise


Project Name: tensorflow/cleverhans
Commit Name: 4d9633c24908ab3a95158c29b5d14c32fff54dae
Time: 2020-01-07
Author: michaelshiyu3@gmail.com
File Name: cleverhans/future/torch/tests/test_attacks.py
Class Name: CommonAttackProperties
Method Name: setUp