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

Python constructor of EMD distance #278

Open
ghost opened this issue Apr 13, 2021 · 0 comments
Open

Python constructor of EMD distance #278

ghost opened this issue Apr 13, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 13, 2021

In python, calling an EMD object constructed by

EMD(rows: int, cols: int)
EMD(rows: int, cols: int, extra_mass_penalty: int)

results in Assertion failed: (C[i][j] >= 0), function operator(), file /Users/travis/build/jura-gresko/metric-wheels/metric/modules/distance/k-structured/EMD.cpp, line 727.

Example:

n = 3
distance = EMD(rows=n, cols=n)
A = [1, 0, 0, 0, 0, 0, 0, 0, 0]
B = [0, 0, 0, 0, 0, 1, 0, 0, 0]
print(distance(A, B))

When trying other values for n and other lengths for A and B, I sometimes also get a segmentation fault.

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

No branches or pull requests

0 participants