Skip to content

Commit 3905b93

Browse files
author
Pierre-Louis Barbarant
committed
Remove tests for dense sinkhorn solvers no longer needed
1 parent 1efe365 commit 3905b93

File tree

1 file changed

+0
-57
lines changed

1 file changed

+0
-57
lines changed

tests/solvers/test_utils.py

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,66 +4,9 @@
44
from fugw.solvers.utils import (
55
solver_sinkhorn_stabilized_sparse,
66
solver_sinkhorn_eps_scaling_sparse,
7-
solver_sinkhorn_stabilized,
8-
solver_sinkhorn_eps_scaling,
97
)
108

119

12-
@pytest.mark.parametrize(
13-
"pot_method, solver",
14-
[
15-
("sinkhorn_stabilized", solver_sinkhorn_stabilized),
16-
("sinkhorn_epsilon_scaling", solver_sinkhorn_eps_scaling),
17-
],
18-
)
19-
def test_solvers_sinkhorn(pot_method, solver):
20-
"""Test consistence of the dense sinkhorn solvers with POT."""
21-
ns = 151
22-
nt = 104
23-
nf = 10
24-
eps = 1.0
25-
26-
niters, tol, eval_freq = 100, 1e-7, 20
27-
28-
ws = torch.ones(ns) / ns
29-
wt = torch.ones(nt) / nt
30-
31-
source_features = torch.rand(ns, nf)
32-
target_features = torch.rand(nt, nf)
33-
34-
cost = torch.cdist(source_features, target_features)
35-
36-
gamma, log = ot.sinkhorn(
37-
ws,
38-
wt,
39-
cost,
40-
eps,
41-
numItermax=niters,
42-
stopThr=tol,
43-
method=pot_method,
44-
print_period=eval_freq,
45-
log=True,
46-
)
47-
48-
# Check the potentials and the transport plan
49-
(alpha, beta), pi = solver(
50-
cost,
51-
ws,
52-
wt,
53-
eps,
54-
numItermax=niters,
55-
tol=tol,
56-
eval_freq=eval_freq,
57-
)
58-
59-
assert torch.allclose(
60-
log["alpha"],
61-
alpha,
62-
)
63-
assert torch.allclose(log["beta"], beta)
64-
assert torch.allclose(gamma, pi)
65-
66-
6710
@pytest.mark.parametrize(
6811
"pot_method, solver",
6912
[

0 commit comments

Comments
 (0)