From a79950df236df3bbc8ea953774635246c7e5b54d Mon Sep 17 00:00:00 2001 From: Lin Hsu Date: Sun, 19 Mar 2023 02:36:23 +0800 Subject: [PATCH 1/2] Remove redundant abs() --- ot/lp/solver_1d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ot/lp/solver_1d.py b/ot/lp/solver_1d.py index e7add89eb..bcfc92079 100644 --- a/ot/lp/solver_1d.py +++ b/ot/lp/solver_1d.py @@ -129,7 +129,7 @@ def wasserstein_1d(u_values, v_values, u_weights=None, v_weights=None, p=1, requ diff_quantiles = nx.abs(u_quantiles - v_quantiles) if p == 1: - return nx.sum(delta * nx.abs(diff_quantiles), axis=0) + return nx.sum(delta * diff_quantiles, axis=0) return nx.sum(delta * nx.power(diff_quantiles, p), axis=0) From a1512af2d4852c8dc6e6527fa4c60f62728c5f6c Mon Sep 17 00:00:00 2001 From: linhsu0723 Date: Mon, 20 Mar 2023 20:54:00 +0800 Subject: [PATCH 2/2] Update RELEASES.md --- RELEASES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index b6e12d9ef..5d966c238 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -17,8 +17,8 @@ - Backend version of `ot.partial` and `ot.smooth` (PR #388) - Added argument for warmstart of dual potentials in Sinkhorn-based methods in `ot.bregman` (PR #437) - Add parameters method in `ot.da.SinkhornTransport` (PR #440) -- `ot.dr` now uses the new Pymanopt API and POT is compatible with current - Pymanopt (PR #443) +- `ot.dr` now uses the new Pymanopt API and POT is compatible with current Pymanopt (PR #443) +- Remove the redundant `nx.abs()` at the end of `wasserstein_1d()` (PR #448) #### Closed issues