Closed zsteve closed 3 years ago
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.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/quadratic_newton.jl | 102 | 104 | 98.08% | ||
<!-- | Total: | 122 | 124 | 98.39% | --> |
Totals | |
---|---|
Change from base Build 1161394375: | 0.9% |
Covered Lines: | 666 |
Relevant Lines: | 682 |
Refactored
quadreg
to follow the conventions introduced for entropy-regularised OT.This PR introduces
QuadraticOT
as a base problem type, with an associated solverQuadraticOTSolver
. The method of Lorenz et al. (2019) is re-implemented as the algorithmQuadraticOTNewton
.The implementation of
solve!
currently relies on two functionsdescent_dir!
anddescent_step!
, which respectively compute the descent direction (in terms of the dual variablesu, v
) and perform the descent step (currently following the Armijo step size rule in the Lorenz paper). This is actually quite general, and an alternative approach could be to renameQuadraticOT
to aRegularizedOT
type for optimal transport problems with arbitrary regularizer.The previous implementation of
quadreg
relied on sparse matrices fromSparseArrays
, but passed between dense and sparse matrices repeatedly since transposes needed to be computed. The implementation in this PR uses dense matrices.This could be implemented in future, but may also mean more work, since
Sinkhorn
maybe should then also inherit fromRegularizedOT
.