-
Notifications
You must be signed in to change notification settings - Fork 82
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
Refactor regularized TI costs #553
Conversation
Add new costs Update tests Final polishing
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #553 +/- ##
==========================================
+ Coverage 89.09% 89.39% +0.30%
==========================================
Files 70 71 +1
Lines 7427 7554 +127
Branches 1051 1080 +29
==========================================
+ Hits 6617 6753 +136
+ Misses 659 650 -9
Partials 151 151
|
src/ott/geometry/costs.py
Outdated
solver = solver.run(x, x=x) | ||
sol = jax.lax.stop_gradient(solver.params) | ||
return fun(sol, x) | ||
x0 = x if x_init is None else x_init |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed the signature, now it will be possible to do:
cost_fn = ...
f = ...
x_inits = ... # (k, d)
f_h = lambda x: jnp.min(jax.vmap(cost_fn.h_transform(f), in_axes=[None, 0])(x, x_inits)))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't check the test files, and I only checked the implementation of Regularization class and Quadratic (as requested).
Let more detailed comments on the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
No description provided.