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

Wasserstein distance for p not in {1,2} #62

Open
gabrielfougeron opened this issue May 19, 2022 · 0 comments
Open

Wasserstein distance for p not in {1,2} #62

gabrielfougeron opened this issue May 19, 2022 · 0 comments

Comments

@gabrielfougeron
Copy link

Hi,

For the first time, I tried to used custom costs in Geomloss to compute W_p distances with general p.
Using the "online" backend, I constructed a Loss with the following f-string as a cost : cost = f"(Powf(Scalprod(X-Y,X-Y),{p/2}) / {p})"
For p=2, this gives cost = "(Powf(Scalprod(X-Y,X-Y),1.0) / 2)".

However, this fails with an attribute error :

File "/home/gfo/anaconda3/envs/ot-geomloss/lib/python3.9/site-packages/keopscore/formulas/VectorizedScalarOp.py", line 12, in dims = set(arg.dim for arg in args) AttributeError: 'float' object has no attribute 'dim'

The same error occurs using the expended exp( a log(b) ) instead of pow(b,a).

Am I doing something wrong ? Is this going to be addressed in the upcoming release ?

Best regards,

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

1 participant