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

Reorganise sinkhorn_stabilized and sinkhorn_stabilized_epsscaling #84

Merged
merged 8 commits into from
May 29, 2021

Conversation

zsteve
Copy link
Member

@zsteve zsteve commented May 29, 2021

This PR updates sinkhorn_stabilized and sinkhorn_stabilized_epsscaling to use the same calling convention as the other sinkhorn functions, the convergence criterion, as well as a general refactor.

I think it should be doable to allow batch computations similar to #67 , but those can be added in a separate PR once both this and #67 have been merged.

@coveralls
Copy link

coveralls commented May 29, 2021

Pull Request Test Coverage Report for Build 888723622

  • 50 of 52 (96.15%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+7.8%) to 96.127%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/OptimalTransport.jl 50 52 96.15%
Totals Coverage Status
Change from base Build 887657287: 7.8%
Covered Lines: 273
Relevant Lines: 284

💛 - Coveralls

@zsteve zsteve requested review from devmotion and davibarreira May 29, 2021 05:15
Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

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

Thanks, these are some good improvements! I planned to update these functions as well and add some tests 👍 There are still some additional improvements that I have in mind but I think they can be postponed to other PRs. I only made some minor suggestions and I think we should fix the sequence of the epsilons right away (it's incorrect currently).

Can you also update the tests to the new format?

src/OptimalTransport.jl Outdated Show resolved Hide resolved
src/OptimalTransport.jl Outdated Show resolved Hide resolved
src/OptimalTransport.jl Show resolved Hide resolved
src/OptimalTransport.jl Outdated Show resolved Hide resolved
src/OptimalTransport.jl Show resolved Hide resolved
src/OptimalTransport.jl Show resolved Hide resolved
src/OptimalTransport.jl Outdated Show resolved Hide resolved
src/OptimalTransport.jl Outdated Show resolved Hide resolved
test/runtests.jl Outdated Show resolved Hide resolved
@zsteve zsteve force-pushed the sinkhorn_stabilized branch from d71a2f1 to a72be90 Compare May 29, 2021 18:18
test/entropic.jl Outdated
# compute optimal transport map (Julia implementation + POT)
eps = 0.001
γ = sinkhorn_stabilized(μ, ν, C, eps; maxiter=5_000)
γ_pot = POT.sinkhorn(μ, ν, C, eps; method="sinkhorn_stabilized", numItermax=5_000)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
γ_pot = POT.sinkhorn(μ, ν, C, eps; method="sinkhorn_stabilized", numItermax=5_000)
γ_pot = POT.sinkhorn(
μ, ν, C, eps; method="sinkhorn_stabilized", numItermax=5_000
)

test/entropic.jl Outdated
# compute optimal transport map (Julia implementation + POT)
eps = 0.001
γ = sinkhorn_stabilized_epsscaling(μ, ν, C, eps; k=5, maxiter=5_000)
γ_pot = POT.sinkhorn(μ, ν, C, eps; method="sinkhorn_stabilized", numItermax=5_000)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
γ_pot = POT.sinkhorn(μ, ν, C, eps; method="sinkhorn_stabilized", numItermax=5_000)
γ_pot = POT.sinkhorn(
μ, ν, C, eps; method="sinkhorn_stabilized", numItermax=5_000
)

@codecov-commenter
Copy link

codecov-commenter commented May 29, 2021

Codecov Report

Merging #84 (a899042) into master (d4e6510) will increase coverage by 7.76%.
The diff coverage is 96.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #84      +/-   ##
==========================================
+ Coverage   88.36%   96.12%   +7.76%     
==========================================
  Files           1        1              
  Lines         275      284       +9     
==========================================
+ Hits          243      273      +30     
+ Misses         32       11      -21     
Impacted Files Coverage Δ
src/OptimalTransport.jl 96.12% <96.15%> (+7.76%) ⬆️

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 d4e6510...a899042. Read the comment docs.

@zsteve zsteve merged commit 845edda into master May 29, 2021
@zsteve zsteve deleted the sinkhorn_stabilized branch May 29, 2021 18:41
@coveralls
Copy link

Pull Request Test Coverage Report for Build 887585953

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

  • 46 of 47 (97.87%) changed or added relevant lines in 1 file are covered.
  • 7 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+8.2%) to 96.516%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/OptimalTransport.jl 46 47 97.87%
Files with Coverage Reduction New Missed Lines %
src/OptimalTransport.jl 7 96.52%
Totals Coverage Status
Change from base Build 886370400: 8.2%
Covered Lines: 277
Relevant Lines: 287

💛 - Coveralls

@coveralls
Copy link

coveralls commented Sep 25, 2024

Pull Request Test Coverage Report for Build 887559779

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

  • 46 of 47 (97.87%) changed or added relevant lines in 1 file are covered.
  • 7 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+8.2%) to 96.516%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/OptimalTransport.jl 46 47 97.87%
Files with Coverage Reduction New Missed Lines %
src/OptimalTransport.jl 7 96.52%
Totals Coverage Status
Change from base Build 886370400: 8.2%
Covered Lines: 277
Relevant Lines: 287

💛 - Coveralls

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.

5 participants