56aba98eb5d8e1402125fe36a92c48306e2a0322,pymc3/tests/test_quadpotential.py,,test_equal_dense,#,76

Before Change


        inv = np.linalg.inv(cov)
        assert np.allclose(inv.dot(cov), np.eye(5))
        x_ = floatX(np.random.randn(5))
        x = tt.vector()
        x.tag.test_value = x_
        pots = [
            quadpotential.quad_potential(cov, False, False),
            quadpotential.quad_potential(inv, True, False),
        ]
        if quadpotential.chol_available:
            pots.append(quadpotential.quad_potential(cov, False, False))

        v = np.linalg.solve(cov, x_)
        e = 0.5 * x_.dot(v)
        for pot in pots:
            v_function = theano.function([x], pot.velocity(x))
            e_function = theano.function([x], pot.energy(x))
            assert np.allclose(v_function(x_), v)
            assert np.allclose(e_function(x_), e)

After Change


        e = 0.5 * x.dot(v)
        for pot in pots:
            v_ = pot.velocity(x)
            e_ = pot.energy(x)
            npt.assert_allclose(v_, v, rtol=1e-4)
            npt.assert_allclose(e_, e, rtol=1e-4)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 13

Instances


Project Name: pymc-devs/pymc3
Commit Name: 56aba98eb5d8e1402125fe36a92c48306e2a0322
Time: 2017-07-19
Author: adrian.seyboldt@gmail.com
File Name: pymc3/tests/test_quadpotential.py
Class Name:
Method Name: test_equal_dense


Project Name: pymc-devs/pymc3
Commit Name: 56aba98eb5d8e1402125fe36a92c48306e2a0322
Time: 2017-07-19
Author: adrian.seyboldt@gmail.com
File Name: pymc3/tests/test_quadpotential.py
Class Name:
Method Name: test_equal_diag


Project Name: pymc-devs/pymc3
Commit Name: 56aba98eb5d8e1402125fe36a92c48306e2a0322
Time: 2017-07-19
Author: adrian.seyboldt@gmail.com
File Name: pymc3/tests/test_quadpotential.py
Class Name:
Method Name: test_elemwise_energy


Project Name: pymc-devs/pymc3
Commit Name: 56aba98eb5d8e1402125fe36a92c48306e2a0322
Time: 2017-07-19
Author: adrian.seyboldt@gmail.com
File Name: pymc3/tests/test_quadpotential.py
Class Name:
Method Name: test_equal_dense