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 ?
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,