Skip to content
Snippets Groups Projects
Commit 22898b8b authored by Vincent POLLET's avatar Vincent POLLET
Browse files

Fix canberra distance for input with elements equal to 0

parent 442475c6
No related branches found
No related tags found
1 merge request!6Resolve "In painting has different output based on computer OS"
Pipeline #41684 passed
This commit is part of merge request !6. Comments created here will be created in the context of that merge request.
......@@ -55,7 +55,7 @@ def canberra_distance(array1, array2):
return np.sum(
np.abs(array1.astype(np.float64) - array2.astype(np.float64))
/ (np.abs(array1.astype(np.float64)) + np.abs(array2.astype(np.float64)))
/ (np.abs(array1.astype(np.float64)) + np.abs(array2.astype(np.float64) + 1.0))
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment