oineus.sliced_wasserstein_distance_diag_corrected¶
- oineus.sliced_wasserstein_distance_diag_corrected(dgm_1, dgm_2, n_directions=100, ignore_inf_points=False, seed=None, directions=None)[source]¶
Diagonal-corrected sliced Wasserstein distance.
Makes the sliced distance behave like true Wasserstein at the diagonal. The 1D rank-matching can pair an off-diagonal point p with the diagonal projection of a different point p’; true Wasserstein never does this (such skew edges can always be straightened to
p <-> diag(p)without raising the cost). The correction re-charges those matches:A point matched to a diagonal slot is charged
|proj(p) - proj(diag(p))|, its distance to its own diagonal projection – not to whichever point’s diagonal stand-in the sort aligned it with.A match between two diagonal stand-ins costs zero.
Arguments are as in
sliced_wasserstein_distance().