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

Custom cost function replicating p=2 doesn't match inbuilt? #56

Open
JPTK opened this issue Mar 10, 2022 · 1 comment
Open

Custom cost function replicating p=2 doesn't match inbuilt? #56

JPTK opened this issue Mar 10, 2022 · 1 comment

Comments

@JPTK
Copy link

JPTK commented Mar 10, 2022

Hi there,

Love the package. One thing I noticed is that I wanted to try using a few custom cost functions. One I used: C(x,y) = 0.5*|| x - y ||^2 only gets the same as the inbuilt p=2 for some sample points, but can occasionally disagree.

Any thoughts on this?

Many thanks,
Jake

@jeanfeydy
Copy link
Owner

Hi @JPTK,

Thanks for your interest in the library!
This is quite surprising: the only case that I can think of is the computation of squared distances in the "tensorized" backend that relies on the polar identity |x-y|^2 = x^2 + y^2 - 2 * (x | y) and may induce small differences due to float precision errors.

Could you maybe provide me with a small example?

Best regards,
Jean

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

2 participants