Describe the bug
The sign of the previous transport plan appears to be incorrect in
proximal_bregman_log_plan_batch.
The current implementation uses:
K_proj = -(C + inner_reg * log_T) / (reg + inner_reg)
The same expression is also used in the grad == "last_step" branch.
However, the proximal subproblem documented immediately above the
implementation is
$$
\min_{T \in \Pi(a,b)}
\langle C-\beta\log T^{(k)},T\rangle
+(\mathrm{reg}+\beta)\sum_{ij}T_{ij}\log T_{ij},
$$
where beta = inner_reg.
Therefore, the corresponding log-kernel should be
$$
K^{(k)}=
-\frac{C-\beta\log T^{(k)}}{\mathrm{reg}+\beta},
$$
which corresponds to:
K_proj = -(C - inner_reg * log_T) / (reg + inner_reg)
For the unregularized case (reg = 0), this becomes
K_proj = log_T - C / inner_reg
which agrees with Algorithm 1 of Xie et al. (2020) and the authors'
reference implementation:
The current implementation instead gives
K_proj = -log_T - C / inner_reg
which reverses the contribution of the previous transport plan.
References
Suggested fix
Replace both occurrences of
K_proj = -(C + inner_reg * log_T) / (reg + inner_reg)
with
K_proj = -(C - inner_reg * log_T) / (reg + inner_reg)
Describe the bug
The sign of the previous transport plan appears to be incorrect in
proximal_bregman_log_plan_batch.The current implementation uses:
The same expression is also used in the
grad == "last_step"branch.However, the proximal subproblem documented immediately above the
implementation is
where
beta = inner_reg.Therefore, the corresponding log-kernel should be
which corresponds to:
For the unregularized case (
reg = 0), this becomeswhich agrees with Algorithm 1 of Xie et al. (2020) and the authors'
reference implementation:
The current implementation instead gives
which reverses the contribution of the previous transport plan.
References
Wasserstein Distance”, UAI 2020:
https://proceedings.mlr.press/v115/xie20b.html
https://github.com/xieyujia/IPOT/blob/master/ipot.py
https://github.com/PythonOT/POT/blob/master/ot/batch/_utils.py
Suggested fix
Replace both occurrences of
with