Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Get rid of scipy dependency by using numpy.
  • Loading branch information
nouiz committed Dec 15, 2015
commit 407fd81b1a5bf8630187eddabe3ff1e22afa6ca7
3 changes: 1 addition & 2 deletions code/hmc/test_hmc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy
from scipy import linalg
import theano

from hmc import HMC_sampler
Expand All @@ -15,7 +14,7 @@ def sampler_on_nd_gaussian(sampler_cls, burnin, n_samples, dim=10):
cov = numpy.array(rng.rand(dim, dim), dtype=theano.config.floatX)
cov = (cov + cov.T) / 2.
cov[numpy.arange(dim), numpy.arange(dim)] = 1.0
cov_inv = linalg.inv(cov)
cov_inv = numpy.linalg.inv(cov)

# Define energy function for a multi-variate Gaussian
def gaussian_energy(x):
Expand Down