-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi, I'm Physics master student in Brazil and I have been using hopsy library for a few months in my research project. Basically I am trying to sort out evenly distributed points within a polytope. I used your 'test.py' file as a base to build my code and it worked fine for a while, but when I recently updated hopsy library on my computer, some of the functions like "MultivariateGaussianModel" and "Run" stopped working. Have these functions had their names changed? How do I use them exactly the same as before?
I'm attaching my code (that's not working anymore) bellow:
import hopsy
import numpy as np
def sorteio(A,b,mu,cov,n_points):
model = hopsy.MultivariateGaussianModel(mu, cov)
problem = hopsy.Problem(A, b, model)
# the run object contains and constructs the markov chains. in the default case, the
# Run object will have a single chain using the Hit-and-Run proposal algorithm and is
# set to produce 10,000 samples.
run = hopsy.Run(problem)
# we finally sample
run.sample(n_points)
# from the run, we can now extract the produced data
data = run.data
# the states is a list of lists of numpy.ndarrays, which can be casted to a numpy.ndarray
# which then has the shape (m,n,d), where m is the number of chains, n the number of samples
# and d the dimenion
states = data.states
return np.array(states)
Metadata
Metadata
Assignees
Labels
No labels