uumami / mhar Goto Github PK
View Code? Open in Web Editor NEWmhar
mhar
Hi Mario,
Thanks for your research and this repository!
I'm trying to use the repository but encounter unreasonable running times for high dimensions. The results reported in the paper seem much better so I assume I'm missing something.
I have N+1 points in N dimensions, defining a convex polytope/hull.
For a small N, the code seems to run perfectly. However, when using N~300, which is my real use case, the "walk" function simply doesn't temrminate.
A minimal example to repoduce my code is attached below.
from mhar import walk
import numpy as np
from scipy.spatial import ConvexHull
import torch
n = torch.cuda.device_count()
print(n)
N=300
pts = np.random.rand(N+1, N)
hull = ConvexHull(pts)
ai = torch.from_numpy(hull.equations[:,:-1]).to(torch.float32).cuda()
bi = torch.from_numpy(-1 * hull.equations[:,-1]).unsqueeze(1).to(torch.float32).cuda()
x_0 = torch.from_numpy(np.mean(pts, axis=0)).unsqueeze(1).to(torch.float32).cuda()
X = walk(z=5, # Padding Parameter
ai=ai, # Inequality matrix
bi=bi, # Inequaliy restrictions
ae=torch.empty(0), # Equality Matrix
be=torch.empty(0), # Equality restriction
x_0=x_0, # Inner Point of the polytope
T=1, # Number of iid Iterations
device='cuda', # Device to use cpu or cuda
warm=0, # Number of iid iterations to burn before saving samples
seed=None, # Automatic random seed
thinning=None # Automatic thinning factor of O(n^3)
)
In the paper, Table B.5, for hypercube with n=500 and z=4000 - running time is reported to be 27.5 seconds.
The code above has been running for an hour now and not terminating.
Could you please help me understanding what I'm missing?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.