-
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
Feature/ulrgw #410
Feature/ulrgw #410
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #410 +/- ##
==========================================
- Coverage 91.40% 90.48% -0.93%
==========================================
Files 55 56 +1
Lines 5943 6251 +308
Branches 866 887 +21
==========================================
+ Hits 5432 5656 +224
- Misses 375 453 +78
- Partials 136 142 +6
|
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 Michal! let's chat :)
|
||
|
||
@jax.tree_util.register_pytree_node_class | ||
class LRGromovWasserstein(sinkhorn.Sinkhorn): |
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.
isn't this supposed to inherite from WasSolver
? It's not clear either why there should be a link to Sinkhorn
(I would understand LRSinkhorn
)
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.
For now, I think it makes sense, since if we were to use WasSolver
with LRSinkhornSolver
, we'd have:
- 3 loops (outermost GW loop, outer loop in LR Sinkhorn, Dykstra loop)
LRSinkhornSolver
would have to be modified to accept a quadratic problem (or have a specific inner solver for unbalanced LR GW, which is more complicated than this)
We definitely need a abstraction for the solvers, this is just temporary; will come up with a better solution to this in the future.
I also think that our current LR GW (balanced) is a bit wrong when it comes to the convergence criterion (we exit the outermost GW loop when the successive costs are close; in the paper it should exist when the errors between succcessive Q/R/g
are close [the convergence criterion for the linearized objective]).
This will be fixed in a future PR once the LR GW (balanced and unbalanced) are unified in this class.
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.
Conceptually, I am not sure exactly what we're inheriting from Sinkhorn
? It seems Sinkhorn
is used as a simpler type of WassersteinSolver
?
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -1,7 +1,6 @@ | |||
{ |
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.
if you are using the primal cost, then it's better to rename the titles to "Primal cost of LR Solution" and " ... of Entropic Solution" to avoid the ambiguity. I am also surprised that the plot of low rank is looks so much like a rank 1 or 2 matrix, can you double check?
Reply via ReviewNB
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.
This LGTM, but I'd like to chat about the inheritance of LRGromovWasserstein
because I am not sure where this is headed! thanks!
|
||
|
||
@jax.tree_util.register_pytree_node_class | ||
class LRGromovWasserstein(sinkhorn.Sinkhorn): |
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.
Conceptually, I am not sure exactly what we're inheriting from Sinkhorn
? It seems Sinkhorn
is used as a simpler type of WassersteinSolver
?
Agreed, we sorely need a better solver hierarchy, let's talk about it! Will just write some tests and merge. |
* Remove low-rank from GromovWasserstein solver * First skeleton loop * Add LRGW implementation * Add ULFGW * Revert change * Add a TODO * Fix `grad_g` in the fused case * Update docs * Remove duplicate citation * Fix cost for the fused case * Fix bugs in TI * Remove unused import * Change way array extraction in LR init works * Disallow LR in the old GW solver * Disallow LR in old GW class * Remove `is_entropic` property * Use `jnp.linalg.norm` * Simplify initializers in GW * Simplify initializer creation for low-rank * Remove temporary name * Fix norms * Fix linkcheck * Remove old initializers test * Fix more initializer tests * Remove `LRQuadraticInitializer`, `reg_ot_cost -> reg_gw_cost` * `host_callback` -> `io_callback` * Fix more initializers tests * Fix more tests * Remove initializer mention from the docs * Remove mention of LR initializer * Start incorporating GWLoss * Simplify reg GW cost computation * Finish `primal_cost` * Don't calculate unbal. grads in balanced case * Fix `primal_cost` in balanced case * Update GW LR notebook * Convert quad problem to LR if possible * Convert quad problem to LR if possible * Regenerate GWLR Sinkhorn * Regenerate `LRSinkhorn` * [ci skip] Fix linter * Fix convergence metric * Undo TODO * Fix factor * Regenerate notebooks * Add tests
Add unbalanced low-rank (fused) GW.
TODOs:
[ ] decide on how to handle/whether to deprecate LR option in GW (would say yes)will be done in a future PRLRSinkhorn
)primal_cost
LRGromovWasserstein
class