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

TI transport map #559

Merged
merged 8 commits into from
Jul 12, 2024
Merged

TI transport map #559

merged 8 commits into from
Jul 12, 2024

Conversation

michalk8
Copy link
Collaborator

No description provided.

@michalk8 michalk8 self-assigned this Jul 11, 2024
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.39%. Comparing base (06b4649) to head (f17b267).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #559   +/-   ##
=======================================
  Coverage   89.38%   89.39%           
=======================================
  Files          71       71           
  Lines        7545     7552    +7     
  Branches     1075     1075           
=======================================
+ Hits         6744     6751    +7     
  Misses        650      650           
  Partials      151      151           
Files Coverage Δ
src/ott/geometry/costs.py 97.16% <100.00%> (+0.04%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

@marcocuturi marcocuturi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thansk a lot Michal! a few comments below

src/ott/geometry/costs.py Outdated Show resolved Hide resolved

np.testing.assert_array_equal(jnp.isfinite(h_transform(x)), True)
transport_fn = cost_fn.transport_map(lambda z: -jnp.sum(z * (A.dot(z))))
transport_fn = jax.jit(transport_fn, static_argnames=["forward"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think a good test would be to transport samples, on xs. get ys, keep them in that order, and then run the Hungarian algorithm and make sure the optimal permutation with cost h is identity (could use scipy's https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.linear_sum_assignment.html)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, works only with the exception of SqPNorm(1.0), changed to SqPNorm(1.05).

src/ott/geometry/costs.py Outdated Show resolved Hide resolved
src/ott/geometry/costs.py Outdated Show resolved Hide resolved
@michalk8 michalk8 merged commit c76e2ac into main Jul 12, 2024
12 checks passed
@michalk8 michalk8 deleted the feature/gt-transport-fn branch July 12, 2024 11:58
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

Successfully merging this pull request may close these issues.

None yet

2 participants