MCPcopy Create free account
hub / github.com/PythonOT/POT / benchmark_naive_gw

Function benchmark_naive_gw

examples/backends/plot_ot_batch.py:182–192  ·  view source on GitHub ↗
(samples_source, samples_target)

Source from the content-addressed store, hash-verified

180
181
182def benchmark_naive_gw(samples_source, samples_target):
183 start = perf_counter()
184 avg_value = 0
185 for i in range(n_problems):
186 C1 = ot.dist(samples_source[i], samples_source[i])
187 C2 = ot.dist(samples_target[i], samples_target[i])
188 res = solve_gromov(C1, C2, max_iter=1000, tol=tol)
189 avg_value += res.value
190 avg_value /= n_problems
191 end = perf_counter()
192 return end - start, avg_value
193
194
195def benchmark_batch_gw(samples_source, samples_target):

Callers 1

plot_ot_batch.pyFile · 0.85

Calls 1

solve_gromovFunction · 0.90

Tested by

no test coverage detected