ott icon indicating copy to clipboard operation
ott copied to clipboard

Euclidean / SqEuclidean and changes in power

Open marcocuturi opened this issue 2 years ago • 2 comments

This refers to issue #156.

This PR introduces a few changes:

  • oldEuclidean is moved to SqEuclidean and continues wokring with naive **2 and vdot
  • Euclidean is now the jnp.linalg.norm(x-y) and is properly differentiated.
  • power=1.0 becomes the new default in PointCloud (which is a lot more coherent!).
  • Expose cost_fn in PointCloud (I think this should be visible, and useful to debug for instance)

marcocuturi avatar Oct 18 '22 07:10 marcocuturi

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Codecov Report

Merging #157 (c863521) into main (b060e2c) will decrease coverage by 5.87%. The diff coverage is 72.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #157      +/-   ##
==========================================
- Coverage   89.84%   83.96%   -5.88%     
==========================================
  Files          51       51              
  Lines        5061     5065       +4     
  Branches      518      519       +1     
==========================================
- Hits         4547     4253     -294     
- Misses        390      660     +270     
- Partials      124      152      +28     
Impacted Files Coverage Δ
ott/core/potentials.py 82.35% <ø> (-4.71%) :arrow_down:
ott/tools/k_means.py 92.54% <0.00%> (-3.11%) :arrow_down:
ott/tools/segment_sinkhorn.py 43.75% <ø> (-56.25%) :arrow_down:
ott/tools/sinkhorn_divergence.py 61.81% <ø> (-32.73%) :arrow_down:
ott/geometry/pointcloud.py 68.62% <64.70%> (-15.25%) :arrow_down:
ott/core/bar_problems.py 74.57% <100.00%> (-9.61%) :arrow_down:
ott/geometry/costs.py 96.51% <100.00%> (+0.08%) :arrow_up:
ott/geometry/grid.py 89.65% <100.00%> (-0.87%) :arrow_down:
ott/core/discrete_barycenter.py 15.58% <0.00%> (-70.13%) :arrow_down:
... and 28 more

codecov-commenter avatar Oct 18 '22 11:10 codecov-commenter