JuliaOptimalTransport / OptimalTransport.jl

Optimal transport algorithms for Julia
https://juliaoptimaltransport.github.io/OptimalTransport.jl/dev
MIT License
93 stars 8 forks source link

Unify `solve!` for `SinkhornSolver` and `SinkhornBarycenterSolver` #123

Closed zsteve closed 2 years ago

zsteve commented 2 years ago

I've combined solve! to have a unified implementation solve!(solver::Union{SinkhornSolver, SinkhornBarycenterSolver}). Taking a type union is not so elegant but it works since we don't have much of a type hierarchy.

The actual steps of Sinkhorn type algorithms are now isolated into calls to:

Since solve! now depends on both solvers, it's now defined in a separate sinkhorn_solve.jl file and included at the end.

codecov-commenter commented 2 years ago

Codecov Report

Merging #123 (db91fe0) into master (9b9b803) will increase coverage by 0.10%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #123      +/-   ##
==========================================
+ Coverage   97.67%   97.77%   +0.10%     
==========================================
  Files          13       14       +1     
  Lines         687      673      -14     
==========================================
- Hits          671      658      -13     
+ Misses         16       15       -1     
Impacted Files Coverage Δ
src/entropic/sinkhorn_barycenter.jl 100.00% <ø> (+2.00%) :arrow_up:
src/entropic/sinkhorn_gibbs.jl 100.00% <ø> (ø)
src/entropic/sinkhorn.jl 100.00% <100.00%> (ø)
src/entropic/sinkhorn_barycenter_gibbs.jl 100.00% <100.00%> (ø)
src/entropic/sinkhorn_solve.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9b9b803...db91fe0. Read the comment docs.

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 1179374576

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Totals Coverage Status
Change from base Build 1178746983: 0.1%
Covered Lines: 658
Relevant Lines: 673

💛 - Coveralls
zsteve commented 2 years ago

Let me know if any additional changes are required before merge!