Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sparse scaling matrix in quadpotential #1685

Merged
merged 1 commit into from
Jan 20, 2017

Conversation

aseyboldt
Copy link
Member

@aseyboldt aseyboldt commented Jan 19, 2017

Non-diagonal scaling matrices seem to be broken at the moment, as they do not work with theano. This pull request should fix that.

Also, think the sparse implementation was incorrect. velocity and random did not match each other.

@twiecki
Copy link
Member

twiecki commented Jan 20, 2017

Thanks @aseyboldt! Looks like some tests failing under python 2.7:

======================================================================
FAIL: pymc3.tests.test_quadpotential.test_elemwise_velocity
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/miniconda2/envs/testenv/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/pymc-devs/pymc3/pymc3/tests/test_quadpotential.py", line 48, in test_elemwise_velocity
    assert np.allclose(v(x_), 1/scaling)
AssertionError
======================================================================
FAIL: pymc3.tests.test_quadpotential.test_elemwise_energy
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/miniconda2/envs/testenv/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/pymc-devs/pymc3/pymc3/tests/test_quadpotential.py", line 61, in test_elemwise_energy
    assert np.allclose(energy(x_), 0.5 * (1/scaling).sum())
AssertionError

@aseyboldt
Copy link
Member Author

Ah, interger division... should work now.

@twiecki
Copy link
Member

twiecki commented Jan 20, 2017

Thanks for the fix and unittests!

@twiecki twiecki merged commit 6cc0d0a into pymc-devs:master Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants