[WIP] Semi-relaxed (fused) gromov-wasserstein divergence with updates of current gromov-wasserstein solvers and dependencies #401
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types of changes
Integration of the semi-relaxed (fused) gromov-wasserstein solvers using conditional gradients --- Related new functions in gromov.py: init_matrix_semirelaxed / semirelaxed_gromov_wasserstein / semirelaxed_gromov_wasserstein2 / semirelaxed_fused_gromov_wasserstein/ semirelaxed_fused_gromov_wasserstein2/ --- Related new functions in optim.py: solve_semirelaxed_gromov_linesearch.
Factorization of the conditional gradient solvers in optim.py to take as entry any kind of linear program solver for the conditional gradient direction, and any kind of line search solver for the optimal line search step. --- Related new functions in optim.py: generic_cg / Might replace functions in optim.py: cg, gcg (an instance of how to replace cgc is given in a potentially temporary function named new_gcg)
New factoring for the (fused) gromov-wasserstein functions to fit the new function generic_cg, and support asymmetric matrices as started in another pull request [PR: Gromov-Wasserstein with asymmetric cost matrices [WIP] Gromov-Wasserstein with asymmetric cost matrices #399] --- Related modified functions in gromov.py: gromov_wasserstein / gromov_wasserstein2 / fused_gromov_wasserstein / fused_gromov_wasserstein2 / gromov_barycenters / fgw_barycenters --- Related new functions in optim.py: solve_gromov_linesearch (generalizing the line seach coded in solve_linesearch, plus speeding up the function).
Updates of the (fused) gromov-wasserstein dictionary learning functions to leverage the new (fused) gromov-wasserstein solvers to also support asymmetric matrices.
[ TO DO]
Motivation and context / Related issue
The current conditional gradient solver (optim.py/cg) does not allow an easy integration of new lp solver, not new line search methods. The upgrade to the function generic_cg allows a such flexiblity.
The integration of the semi-relaxed fgw (srfgw) requires new lp solver and line-search solver, hence fits well with the function generic_cg. Moreover the implementation srfgw supports symmetric and asymmetric matrices, so fgw solvers have been updated to support asymmetric matrices for the sake of consistency.
The implementation of the (fused) gromov-wasserstein dictionary learning was also restrained to symmetric matrices. Actually wrong if asymmetric matrices were provided or if the dictionary atoms were not projected onto the set of symmetric matrices.
How has this been tested (if it applies)
PR checklist